]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/format_args.stderr
`assertions_on_result_states` fix suggestion when `assert!` not in a statement
[rust.git] / tests / ui / format_args.stderr
index 0aca1c1a0dfb9a3608fcc455211ef2f2977266d1..aa6e3659b43b519d19f14fa7ecd395a7d7763bda 100644 (file)
@@ -126,5 +126,17 @@ error: `to_string` applied to a type that implements `Display` in `println!` arg
 LL |     println!("{foo}{bar}", bar = "bar", foo = "foo".to_string());
    |                                                    ^^^^^^^^^^^^ help: remove this
 
-error: aborting due to 21 previous errors
+error: `to_string` applied to a type that implements `Display` in `format!` args
+  --> $DIR/format_args.rs:142:38
+   |
+LL |         let x = format!("{} {}", a, b.to_string());
+   |                                      ^^^^^^^^^^^^ help: remove this
+
+error: `to_string` applied to a type that implements `Display` in `println!` args
+  --> $DIR/format_args.rs:156:24
+   |
+LL |         println!("{}", original[..10].to_string());
+   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use this: `&original[..10]`
+
+error: aborting due to 23 previous errors