mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
b875c53d2c
rustups https://github.com/rust-lang/rust/pull/69189 which is part of https://github.com/rust-lang/rust/pull/70085 (at least I think this is the only pr that changes clippy test stdout)
55 lines
2.6 KiB
Text
55 lines
2.6 KiB
Text
error: calling `to_string` on `&&str`
|
|
--> $DIR/inefficient_to_string.rs:11:21
|
|
|
|
|
LL | let _: String = rrstr.to_string();
|
|
| ^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstr).to_string()`
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/inefficient_to_string.rs:2:9
|
|
|
|
|
LL | #![deny(clippy::inefficient_to_string)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
= help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
|
|
|
|
error: calling `to_string` on `&&&str`
|
|
--> $DIR/inefficient_to_string.rs:12:21
|
|
|
|
|
LL | let _: String = rrrstr.to_string();
|
|
| ^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrstr).to_string()`
|
|
|
|
|
= help: `&&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
|
|
|
|
error: calling `to_string` on `&&std::string::String`
|
|
--> $DIR/inefficient_to_string.rs:20:21
|
|
|
|
|
LL | let _: String = rrstring.to_string();
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstring).to_string()`
|
|
|
|
|
= help: `&std::string::String` implements `ToString` through a slower blanket impl, but `std::string::String` has a fast specialization of `ToString`
|
|
|
|
error: calling `to_string` on `&&&std::string::String`
|
|
--> $DIR/inefficient_to_string.rs:21:21
|
|
|
|
|
LL | let _: String = rrrstring.to_string();
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrstring).to_string()`
|
|
|
|
|
= help: `&&std::string::String` implements `ToString` through a slower blanket impl, but `std::string::String` has a fast specialization of `ToString`
|
|
|
|
error: calling `to_string` on `&&std::borrow::Cow<str>`
|
|
--> $DIR/inefficient_to_string.rs:29:21
|
|
|
|
|
LL | let _: String = rrcow.to_string();
|
|
| ^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrcow).to_string()`
|
|
|
|
|
= help: `&std::borrow::Cow<str>` implements `ToString` through a slower blanket impl, but `std::borrow::Cow<str>` has a fast specialization of `ToString`
|
|
|
|
error: calling `to_string` on `&&&std::borrow::Cow<str>`
|
|
--> $DIR/inefficient_to_string.rs:30:21
|
|
|
|
|
LL | let _: String = rrrcow.to_string();
|
|
| ^^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(**rrrcow).to_string()`
|
|
|
|
|
= help: `&&std::borrow::Cow<str>` implements `ToString` through a slower blanket impl, but `std::borrow::Cow<str>` has a fast specialization of `ToString`
|
|
|
|
error: aborting due to 6 previous errors
|
|
|