@@ -178,6 +178,18 @@ LL - println!("{:.1}", local_f64);
178178LL + println!("{local_f64:.1}");
179179 |
180180
181+ error: variables can be used directly in the `format!` string
182+ --> $DIR/uninlined_format_args.rs:64:5
183+ |
184+ LL | println!("Hello {} is {:.*}", "x", local_i32, local_f64);
185+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
186+ |
187+ help: change this to
188+ |
189+ LL - println!("Hello {} is {:.*}", "x", local_i32, local_f64);
190+ LL + println!("Hello x is {local_f64:.local_i32$}");
191+ |
192+
181193error: variables can be used directly in the `format!` string
182194 --> $DIR/uninlined_format_args.rs:67:5
183195 |
@@ -407,63 +419,27 @@ LL + println!("{local_f64} {local_i32} {local_f64} {local_i32}");
407419 |
408420
409421error: variables can be used directly in the `format!` string
410- --> $DIR/uninlined_format_args.rs:89:5
411- |
412- LL | println!("{v}", v = local_i32);
413- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
414- |
415- help: change this to
416- |
417- LL - println!("{v}", v = local_i32);
418- LL + println!("{local_i32}");
419- |
420-
421- error: variables can be used directly in the `format!` string
422- --> $DIR/uninlined_format_args.rs:90:5
423- |
424- LL | println!("{local_i32:0$}", width);
425- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
426- |
427- help: change this to
428- |
429- LL - println!("{local_i32:0$}", width);
430- LL + println!("{local_i32:width$}");
431- |
432-
433- error: variables can be used directly in the `format!` string
434- --> $DIR/uninlined_format_args.rs:91:5
422+ --> $DIR/uninlined_format_args.rs:88:5
435423 |
436- LL | println!("{local_i32:w$} ", w = width );
424+ LL | println!("{1} {0} ", "str", local_i32 );
437425 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
438426 |
439427help: change this to
440428 |
441- LL - println!("{local_i32:w$} ", w = width );
442- LL + println!("{local_i32:width$} ");
429+ LL - println!("{1} {0} ", "str", local_i32 );
430+ LL + println!("{local_i32} str ");
443431 |
444432
445433error: variables can be used directly in the `format!` string
446- --> $DIR/uninlined_format_args.rs:92:5
447- |
448- LL | println!("{local_i32:.0$}", prec);
449- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
450- |
451- help: change this to
452- |
453- LL - println!("{local_i32:.0$}", prec);
454- LL + println!("{local_i32:.prec$}");
455- |
456-
457- error: variables can be used directly in the `format!` string
458- --> $DIR/uninlined_format_args.rs:93:5
434+ --> $DIR/uninlined_format_args.rs:89:5
459435 |
460- LL | println!("{local_i32:.p$ }", p = prec );
461- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
436+ LL | println!("{v }", v = local_i32 );
437+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
462438 |
463439help: change this to
464440 |
465- LL - println!("{local_i32:.p$ }", p = prec );
466- LL + println!("{local_i32:.prec$ }");
441+ LL - println!("{v }", v = local_i32 );
442+ LL + println!("{local_i32}");
467443 |
468444
469445error: variables can be used directly in the `format!` string
@@ -845,5 +821,89 @@ LL - println!("expand='{}'", local_i32);
845821LL + println!("expand='{local_i32}'");
846822 |
847823
848- error: aborting due to 71 previous errors
824+ error: variables can be used directly in the `format!` string
825+ --> $DIR/uninlined_format_args.rs:278:5
826+ |
827+ LL | println!("{}", "foo");
828+ | ^^^^^^^^^^^^^^^^^^^^^
829+ |
830+ help: change this to
831+ |
832+ LL - println!("{}", "foo");
833+ LL + println!("foo");
834+ |
835+
836+ error: variables can be used directly in the `format!` string
837+ --> $DIR/uninlined_format_args.rs:279:5
838+ |
839+ LL | println!("{:5}", "foo");
840+ | ^^^^^^^^^^^^^^^^^^^^^^^
841+ |
842+ help: change this to
843+ |
844+ LL - println!("{:5}", "foo");
845+ LL + println!("foo");
846+ |
847+
848+ error: variables can be used directly in the `format!` string
849+ --> $DIR/uninlined_format_args.rs:281:5
850+ |
851+ LL | println!("{:-5}", "foo");
852+ | ^^^^^^^^^^^^^^^^^^^^^^^^
853+ |
854+ help: change this to
855+ |
856+ LL - println!("{:-5}", "foo");
857+ LL + println!("foo");
858+ |
859+
860+ error: variables can be used directly in the `format!` string
861+ --> $DIR/uninlined_format_args.rs:283:5
862+ |
863+ LL | println!("var {} lit {}", var, "foo");
864+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
865+ |
866+ help: change this to
867+ |
868+ LL - println!("var {} lit {}", var, "foo");
869+ LL + println!("var {var} lit foo");
870+ |
871+
872+ error: variables can be used directly in the `format!` string
873+ --> $DIR/uninlined_format_args.rs:284:5
874+ |
875+ LL | println!("var {1} lit {0}", "foo", var);
876+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
877+ |
878+ help: change this to
879+ |
880+ LL - println!("var {1} lit {0}", "foo", var);
881+ LL + println!("var {var} lit foo");
882+ |
883+
884+ error: variables can be used directly in the `format!` string
885+ --> $DIR/uninlined_format_args.rs:285:5
886+ |
887+ LL | println!("var {} lit {0}", "foo");
888+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
889+ |
890+ help: change this to
891+ |
892+ LL - println!("var {} lit {0}", "foo");
893+ LL + println!("var foo lit foo");
894+ |
895+
896+ error: variables can be used directly in the `format!` string
897+ --> $DIR/uninlined_format_args.rs:286:5
898+ |
899+ LL | println!("var {0} lit {} {},", "foo", var);
900+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
901+ |
902+ help: change this to
903+ |
904+ LL - println!("var {0} lit {} {},", "foo", var);
905+ LL + println!("var foo lit foo {var},");
906+ |
907+
908+ error: aborting due to 76 previous errors
849909
0 commit comments