2021-06-03 06:41:37 +00:00
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:59:14
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | Some(ref x) => x,
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^ help: try: `x`
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-borrow` implied by `-D warnings`
|
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:65:14
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | Some(ref x) => *x,
|
|
|
|
| ^^^^^
|
|
|
|
|
|
2023-07-17 08:19:29 +00:00
|
|
|
help: try
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | Some(x) => x,
|
2021-08-11 14:21:33 +00:00
|
|
|
| ~ ~
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:71:14
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | Some(ref x) => {
|
|
|
|
| ^^^^^
|
|
|
|
|
|
2023-07-17 08:19:29 +00:00
|
|
|
help: try
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ Some(x) => {
|
2021-06-03 06:41:37 +00:00
|
|
|
LL | f1(x);
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ f1(x);
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:81:14
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | Some(ref x) => m1!(x),
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^ help: try: `x`
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:86:15
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | let _ = |&ref x: &&String| {
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^ help: try: `x`
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:91:10
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | let (ref y,) = (&x,);
|
|
|
|
| ^^^^^
|
|
|
|
|
|
2023-07-17 08:19:29 +00:00
|
|
|
help: try
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ let (y,) = (&x,);
|
|
|
|
LL ~ let _: &String = y;
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:101:14
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | Some(ref x) => x.0,
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^ help: try: `x`
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:111:14
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | E::A(ref x) | E::B(ref x) => *x,
|
|
|
|
| ^^^^^ ^^^^^
|
|
|
|
|
|
2023-07-17 08:19:29 +00:00
|
|
|
help: try
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | E::A(x) | E::B(x) => x,
|
2021-08-11 14:21:33 +00:00
|
|
|
| ~ ~ ~
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:117:21
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(ref x) = Some(&String::new());
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^ help: try: `x`
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:125:12
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | fn f2<'a>(&ref x: &&'a String) -> &'a String {
|
|
|
|
| ^^^^^
|
|
|
|
|
|
2023-07-17 08:19:29 +00:00
|
|
|
help: try
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
|
2021-06-03 06:41:37 +00:00
|
|
|
LL | let _: &String = x;
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ x
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:132:11
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | fn f(&ref x: &&String) {
|
2023-07-17 08:19:29 +00:00
|
|
|
| ^^^^^ help: try: `x`
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2021-11-04 12:52:36 +00:00
|
|
|
--> $DIR/needless_borrow_pat.rs:140:11
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | fn f(&ref x: &&String) {
|
|
|
|
| ^^^^^
|
|
|
|
|
|
2023-07-17 08:19:29 +00:00
|
|
|
help: try
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ fn f(&x: &&String) {
|
|
|
|
LL ~ let _: &String = x;
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 12 previous errors
|
|
|
|
|