mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 01:55:03 +00:00
ebd8d31542
"try this" -> "try" Current help messages contain a mix of "try", "try this", and one "try this instead". In the spirit of #10631, this PR adopts the first, as it is the most concise. It also updates the `lint_message_conventions` test to catch cases of "try this". (Aside: #10120 unfairly contained multiple changes in one PR. I am trying to break that PR up into smaller pieces.) changelog: Make help messages more concise ("try this" -> "try").
75 lines
2.2 KiB
Plaintext
75 lines
2.2 KiB
Plaintext
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:47:18
|
|
|
|
|
LL | foo_rstr(rstr.as_ref());
|
|
| ^^^^^^^^^^^^^ help: try: `rstr`
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/useless_asref.rs:2:9
|
|
|
|
|
LL | #![deny(clippy::useless_asref)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:49:20
|
|
|
|
|
LL | foo_rslice(rslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^ help: try: `rslice`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> $DIR/useless_asref.rs:53:21
|
|
|
|
|
LL | foo_mrslice(mrslice.as_mut());
|
|
| ^^^^^^^^^^^^^^^^ help: try: `mrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:55:20
|
|
|
|
|
LL | foo_rslice(mrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^ help: try: `mrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:62:20
|
|
|
|
|
LL | foo_rslice(rrrrrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^ help: try: `rrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:64:18
|
|
|
|
|
LL | foo_rstr(rrrrrstr.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^ help: try: `rrrrrstr`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> $DIR/useless_asref.rs:69:21
|
|
|
|
|
LL | foo_mrslice(mrrrrrslice.as_mut());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:71:20
|
|
|
|
|
LL | foo_rslice(mrrrrrslice.as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try: `mrrrrrslice`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:75:16
|
|
|
|
|
LL | foo_rrrrmr((&&&&MoreRef).as_ref());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&&&&MoreRef)`
|
|
|
|
error: this call to `as_mut` does nothing
|
|
--> $DIR/useless_asref.rs:125:13
|
|
|
|
|
LL | foo_mrt(mrt.as_mut());
|
|
| ^^^^^^^^^^^^ help: try: `mrt`
|
|
|
|
error: this call to `as_ref` does nothing
|
|
--> $DIR/useless_asref.rs:127:12
|
|
|
|
|
LL | foo_rt(mrt.as_ref());
|
|
| ^^^^^^^^^^^^ help: try: `mrt`
|
|
|
|
error: aborting due to 11 previous errors
|
|
|