rust-clippy/tests/ui/needless_borrow_pat.stderr

117 lines
2.7 KiB
Text
Raw Normal View History

error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:59:14
|
LL | Some(ref x) => x,
2023-07-01 11:08:01 +00:00
| ^^^^^ help: try: `x`
|
= note: `-D clippy::needless-borrow` implied by `-D warnings`
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:67:14
|
LL | Some(ref x) => *x,
| ^^^^^
|
2023-07-01 11:08:01 +00:00
help: try
|
LL | Some(x) => x,
2021-08-11 14:21:33 +00:00
| ~ ~
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:74:14
|
LL | Some(ref x) => {
| ^^^^^
|
2023-07-01 11:08:01 +00:00
help: try
|
2021-08-11 14:21:33 +00:00
LL ~ Some(x) => {
LL |
LL | f1(x);
2021-08-11 14:21:33 +00:00
LL ~ f1(x);
|
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:85:14
|
LL | Some(ref x) => m1!(x),
2023-07-01 11:08:01 +00:00
| ^^^^^ help: try: `x`
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:91:15
|
LL | let _ = |&ref x: &&String| {
2023-07-01 11:08:01 +00:00
| ^^^^^ help: try: `x`
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:97:10
|
LL | let (ref y,) = (&x,);
| ^^^^^
|
2023-07-01 11:08:01 +00:00
help: try
|
2021-08-11 14:21:33 +00:00
LL ~ let (y,) = (&x,);
LL |
2021-08-11 14:21:33 +00:00
LL ~ let _: &String = y;
|
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:108:14
|
LL | Some(ref x) => x.0,
2023-07-01 11:08:01 +00:00
| ^^^^^ help: try: `x`
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:119:14
|
LL | E::A(ref x) | E::B(ref x) => *x,
| ^^^^^ ^^^^^
|
2023-07-01 11:08:01 +00:00
help: try
|
LL | E::A(x) | E::B(x) => x,
2021-08-11 14:21:33 +00:00
| ~ ~ ~
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:126:21
|
LL | if let Some(ref x) = Some(&String::new());
2023-07-01 11:08:01 +00:00
| ^^^^^ help: try: `x`
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:135:12
|
LL | fn f2<'a>(&ref x: &&'a String) -> &'a String {
| ^^^^^
|
2023-07-01 11:08:01 +00:00
help: try
|
2021-08-11 14:21:33 +00:00
LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
LL |
LL | let _: &String = x;
2021-08-11 14:21:33 +00:00
LL ~ x
|
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:143:11
|
LL | fn f(&ref x: &&String) {
2023-07-01 11:08:01 +00:00
| ^^^^^ help: try: `x`
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:152:11
|
LL | fn f(&ref x: &&String) {
| ^^^^^
|
2023-07-01 11:08:01 +00:00
help: try
|
2021-08-11 14:21:33 +00:00
LL ~ fn f(&x: &&String) {
LL |
2021-08-11 14:21:33 +00:00
LL ~ let _: &String = x;
|
error: aborting due to 12 previous errors