@@ -42,5 +42,38 @@ help: consider using a positional formatting argument instead
4242LL | format!("{1} {} {baz}", "aa", foo.field, baz = 3);
4343 | ~ +++++++++++
4444
45- error: aborting due to 4 previous errors
45+ error: invalid format string: field access isn't supported
46+ --> $DIR/struct-field-as-captured-argument.rs:15:15
47+ |
48+ LL | format!("{foo.field:?} {} {baz}", "aa", baz = 3);
49+ | ^^^^^^^^^ not supported in format string
50+ |
51+ help: consider using a positional formatting argument instead
52+ |
53+ LL | format!("{1:?} {} {baz}", "aa", foo.field, baz = 3);
54+ | ~ +++++++++++
55+
56+ error: invalid format string: field access isn't supported
57+ --> $DIR/struct-field-as-captured-argument.rs:16:15
58+ |
59+ LL | format!("{foo.field:#?} {} {baz}", "aa", baz = 3);
60+ | ^^^^^^^^^ not supported in format string
61+ |
62+ help: consider using a positional formatting argument instead
63+ |
64+ LL | format!("{1:#?} {} {baz}", "aa", foo.field, baz = 3);
65+ | ~ +++++++++++
66+
67+ error: invalid format string: field access isn't supported
68+ --> $DIR/struct-field-as-captured-argument.rs:17:15
69+ |
70+ LL | format!("{foo.field:.3} {} {baz}", "aa", baz = 3);
71+ | ^^^^^^^^^ not supported in format string
72+ |
73+ help: consider using a positional formatting argument instead
74+ |
75+ LL | format!("{1:.3} {} {baz}", "aa", foo.field, baz = 3);
76+ | ~ +++++++++++
77+
78+ error: aborting due to 7 previous errors
4679
0 commit comments