rust-clippy/tests/ui/ref_binding_to_reference.stderr

89 lines
1.9 KiB
Text
Raw Normal View History

error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:31:14
|
LL | Some(ref x) => x,
| ^^^^^
|
= note: `-D clippy::ref-binding-to-reference` implied by `-D warnings`
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/ref_binding_to_reference.rs:37: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 | f1(x);
2021-08-11 14:21:33 +00:00
LL ~ f1(x);
LL ~ &x
|
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:47:14
|
LL | Some(ref x) => m2!(x),
| ^^^^^
|
2023-07-01 11:08:01 +00:00
help: try
|
LL | Some(x) => m2!(&x),
2021-08-11 14:21:33 +00:00
| ~ ~~
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:52:15
|
LL | let _ = |&ref x: &&String| {
| ^^^^^
|
2023-07-01 11:08:01 +00:00
help: try
|
2021-08-11 14:21:33 +00:00
LL ~ let _ = |&x: &&String| {
LL ~ let _: &&String = &x;
|
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:58: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 ~ let _: &&String = &x;
LL ~ x
|
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:65: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 ~ let _: &&String = &x;
|
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:73: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 ~ let _: &&String = &x;
|
error: aborting due to 7 previous errors