]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/tests/ui/format.fixed
Merge commit '3c7e7dbc1583a0b06df5bd7623dd354a4debd23d' into clippyup
[rust.git] / src / tools / clippy / tests / ui / format.fixed
index 64cb7b1cfb80f6c33ff5e81f7af29cceb1e8b73d..f4db2d20c713c0b4dc1d83591e6b6eceb00fe7cc 100644 (file)
@@ -1,6 +1,11 @@
 // run-rustfix
 
-#![allow(clippy::print_literal, clippy::redundant_clone, clippy::to_string_in_format_args)]
+#![allow(
+    clippy::print_literal,
+    clippy::redundant_clone,
+    clippy::to_string_in_format_args,
+    clippy::needless_borrow
+)]
 #![warn(clippy::useless_format)]
 
 struct Foo(pub String);
@@ -73,4 +78,16 @@ fn main() {
     let _s: String = (&*v.join("\n")).to_string();
 
     format!("prepend {:+}", "s");
+
+    // Issue #8290
+    let x = "foo";
+    let _ = x.to_string();
+    let _ = format!("{x:?}"); // Don't lint on debug
+    let _ = x.to_string();
+
+    // Issue #9234
+    let abc = "abc";
+    let _ = abc.to_string();
+    let xx = "xx";
+    let _ = xx.to_string();
 }