2021-06-03 06:41:37 +00:00
|
|
|
error: this pattern creates a reference to a reference
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/ref_binding_to_reference.rs:30:14
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | Some(ref x) => x,
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
= note: `-D clippy::ref-binding-to-reference` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::ref_binding_to_reference)]`
|
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
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/ref_binding_to_reference.rs:38: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) => {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL |
|
2021-06-03 06:41:37 +00:00
|
|
|
LL | f1(x);
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ f1(x);
|
|
|
|
LL ~ &x
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/ref_binding_to_reference.rs:49:14
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | Some(ref x) => m2!(x),
|
|
|
|
| ^^^^^
|
|
|
|
|
|
2023-07-17 08:19:29 +00:00
|
|
|
help: try
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | Some(x) => m2!(&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
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/ref_binding_to_reference.rs:55:15
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
LL | let _ = |&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 ~ let _ = |&x: &&String| {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL |
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ let _: &&String = &x;
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/ref_binding_to_reference.rs:62: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 {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL |
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ let _: &&String = &x;
|
|
|
|
LL ~ x
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/ref_binding_to_reference.rs:70: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) {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL |
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ let _: &&String = &x;
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: this pattern creates a reference to a reference
|
2024-02-10 22:31:36 +00:00
|
|
|
--> tests/ui/ref_binding_to_reference.rs:79: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) {
|
2023-08-24 19:32:12 +00:00
|
|
|
LL |
|
2021-08-11 14:21:33 +00:00
|
|
|
LL ~ let _: &&String = &x;
|
2021-06-03 06:41:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
error: aborting due to 7 previous errors
|
|
|
|
|