fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
925 B18 linesraw
1// run-rustfix
2
3#[derive(Debug)]
4struct Foo {
5    field: usize,
6}
7
8fn main() {
9    let foo = Foo { field: 0 };
10    let bar = 3;
11    format!("{0}", foo.field); //~ ERROR invalid format string: field access isn't supported
12    format!("{1} {} {bar}", "aa", foo.field); //~ ERROR invalid format string: field access isn't supported
13    format!("{2} {} {1} {bar}", "aa", "bb", foo.field); //~ ERROR invalid format string: field access isn't supported
14    format!("{1} {} {baz}", "aa", foo.field, baz = 3); //~ ERROR invalid format string: field access isn't supported
15    format!("{1:?} {} {baz}", "aa", foo.field, baz = 3); //~ ERROR invalid format string: field access isn't supported
16    format!("{1:#?} {} {baz}", "aa", foo.field, baz = 3); //~ ERROR invalid format string: field access isn't supported
17    format!("{1:.3} {} {baz}", "aa", foo.field, baz = 3); //~ ERROR invalid format string: field access isn't supported
18}