rust-clippy/tests/ui/inefficient_to_string.stderr
Michael Zhang 2106a23966
Update help text in inefficient_to_string
Co-Authored-By: Manish Goregaokar <manishsmail@gmail.com>
2019-10-17 19:13:32 -04:00

55 lines
2.6 KiB
Text

error: calling `to_string` on `&&str`
--> $DIR/inefficient_to_string.rs:12:21
|
LL | let _: String = rrstr.to_string();
| ^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstr).to_string()`
|
note: lint level 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:13: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:21: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:22: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:30: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:31: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