mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 00:53:31 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
74 lines
2.2 KiB
Text
74 lines
2.2 KiB
Text
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:41:18
|
|
|
|
|
LL | foo_rstr(rstr.as_ref());
|
|
| ^^^^^^^^^^^^^ help: try this: `rstr`
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/useless_asref.rs:1:9
|
|
|
|
|
LL | #![deny(clippy::useless_asref)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:43:20
|
|
|
|
|
LL | foo_rslice(rslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^ help: try this: `rslice`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> $DIR/useless_asref.rs:47:21
|
|
|
|
|
LL | foo_mrslice(mrslice.as_mut());
|
|
| ^^^^^^^^^^^^^^^^ help: try this: `mrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:49:20
|
|
|
|
|
LL | foo_rslice(mrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^ help: try this: `mrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:56:20
|
|
|
|
|
LL | foo_rslice(rrrrrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try this: `rrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:58:18
|
|
|
|
|
LL | foo_rstr(rrrrrstr.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^ help: try this: `rrrrrstr`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> $DIR/useless_asref.rs:63:21
|
|
|
|
|
LL | foo_mrslice(mrrrrrslice.as_mut());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try this: `mrrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:65:20
|
|
|
|
|
LL | foo_rslice(mrrrrrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try this: `mrrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:68:16
|
|
|
|
|
LL | foo_rrrrmr((&&&&MoreRef).as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try this: `(&&&&MoreRef)`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> $DIR/useless_asref.rs:118:13
|
|
|
|
|
LL | foo_mrt(mrt.as_mut());
|
|
| ^^^^^^^^^^^^ help: try this: `mrt`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:120:12
|
|
|
|
|
LL | foo_rt(mrt.as_ref());
|
|
| ^^^^^^^^^^^^ help: try this: `mrt`
|
|
|
|
error: aborting due to 11 previous errors
|
|
|