diff options
| author | lukas <lukas.walter@aceart.de> | 2024-07-04 16:47:20 +0200 |
|---|---|---|
| committer | lukas <lukas.walter@aceart.de> | 2024-07-06 14:24:20 +0200 |
| commit | 3e9c9a05a825005cf0b199d4f68edf8817599ade (patch) | |
| tree | 96d341f2ec83a5f68cd394c1048f9ab943e0d918 /tests/ui/fmt/struct-field-as-captured-argument.rs | |
| parent | 28cc0b643d6c07e2e0ba24a85f397963961b4c0d (diff) | |
| download | rust-3e9c9a05a825005cf0b199d4f68edf8817599ade.tar.gz rust-3e9c9a05a825005cf0b199d4f68edf8817599ade.zip | |
Mark format! with must_use hint
Diffstat (limited to 'tests/ui/fmt/struct-field-as-captured-argument.rs')
| -rw-r--r-- | tests/ui/fmt/struct-field-as-captured-argument.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/ui/fmt/struct-field-as-captured-argument.rs b/tests/ui/fmt/struct-field-as-captured-argument.rs index 6a875a85848..325b4e3a218 100644 --- a/tests/ui/fmt/struct-field-as-captured-argument.rs +++ b/tests/ui/fmt/struct-field-as-captured-argument.rs @@ -8,11 +8,11 @@ struct Foo { fn main() { let foo = Foo { field: 0 }; let bar = 3; - format!("{foo.field}"); //~ ERROR invalid format string: field access isn't supported - format!("{foo.field} {} {bar}", "aa"); //~ ERROR invalid format string: field access isn't supported - format!("{foo.field} {} {1} {bar}", "aa", "bb"); //~ ERROR invalid format string: field access isn't supported - format!("{foo.field} {} {baz}", "aa", baz = 3); //~ ERROR invalid format string: field access isn't supported - format!("{foo.field:?} {} {baz}", "aa", baz = 3); //~ ERROR invalid format string: field access isn't supported - format!("{foo.field:#?} {} {baz}", "aa", baz = 3); //~ ERROR invalid format string: field access isn't supported - format!("{foo.field:.3} {} {baz}", "aa", baz = 3); //~ ERROR invalid format string: field access isn't supported + let _ = format!("{foo.field}"); //~ ERROR invalid format string: field access isn't supported + let _ = format!("{foo.field} {} {bar}", "aa"); //~ ERROR invalid format string: field access isn't supported + let _ = format!("{foo.field} {} {1} {bar}", "aa", "bb"); //~ ERROR invalid format string: field access isn't supported + let _ = format!("{foo.field} {} {baz}", "aa", baz = 3); //~ ERROR invalid format string: field access isn't supported + let _ = format!("{foo.field:?} {} {baz}", "aa", baz = 3); //~ ERROR invalid format string: field access isn't supported + let _ = format!("{foo.field:#?} {} {baz}", "aa", baz = 3); //~ ERROR invalid format string: field access isn't supported + let _ = format!("{foo.field:.3} {} {baz}", "aa", baz = 3); //~ ERROR invalid format string: field access isn't supported } |
