Files
rust/tests/ui/ref_binding_to_reference.stderr
Esteban Küber 3a0b1ae59d Show diff suggestion format on verbose replacement
```
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
  --> $DIR/attempted-access-non-fatal.rs:7:15
   |
LL |     let _ = 2.l;
   |               ^
   |
help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
   |
LL -     let _ = 2.l;
LL +     let _ = 2.0f64;
   |
```
2025-02-10 20:21:39 +00:00

97 lines
2.0 KiB
Plaintext

error: this pattern creates a reference to a reference
--> tests/ui/ref_binding_to_reference.rs:30:14
|
LL | Some(ref x) => x,
| ^^^^^
|
= note: `-D clippy::ref-binding-to-reference` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::ref_binding_to_reference)]`
help: try
|
LL - Some(ref x) => x,
LL + Some(x) => &x,
|
error: this pattern creates a reference to a reference
--> tests/ui/ref_binding_to_reference.rs:38:14
|
LL | Some(ref x) => {
| ^^^^^
|
help: try
|
LL ~ Some(x) => {
LL |
LL | f1(x);
LL ~ f1(x);
LL ~ &x
|
error: this pattern creates a reference to a reference
--> tests/ui/ref_binding_to_reference.rs:49:14
|
LL | Some(ref x) => m2!(x),
| ^^^^^
|
help: try
|
LL - Some(ref x) => m2!(x),
LL + Some(x) => m2!(&x),
|
error: this pattern creates a reference to a reference
--> tests/ui/ref_binding_to_reference.rs:55:15
|
LL | let _ = |&ref x: &&String| {
| ^^^^^
|
help: try
|
LL ~ let _ = |&x: &&String| {
LL |
LL ~ let _: &&String = &x;
|
error: this pattern creates a reference to a reference
--> tests/ui/ref_binding_to_reference.rs:62:12
|
LL | fn f2<'a>(&ref x: &&'a String) -> &'a String {
| ^^^^^
|
help: try
|
LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
LL |
LL ~ let _: &&String = &x;
LL ~ x
|
error: this pattern creates a reference to a reference
--> tests/ui/ref_binding_to_reference.rs:70:11
|
LL | fn f(&ref x: &&String) {
| ^^^^^
|
help: try
|
LL ~ fn f(&x: &&String) {
LL |
LL ~ let _: &&String = &x;
|
error: this pattern creates a reference to a reference
--> tests/ui/ref_binding_to_reference.rs:79:11
|
LL | fn f(&ref x: &&String) {
| ^^^^^
|
help: try
|
LL ~ fn f(&x: &&String) {
LL |
LL ~ let _: &&String = &x;
|
error: aborting due to 7 previous errors