]>
git.proxmox.com Git - rustc.git/blob - tests/ui/macros/issue-98466.rs
7 println
!("_x is {}", _x
= 5);
8 //~^ WARNING named argument `_x` is not used by name [named_arguments_used_positionally]
9 //~| HELP use the named argument by name to avoid ambiguity
10 println
!("_x is {}", y
= _x
);
11 //~^ WARNING named argument `y` is not used by name [named_arguments_used_positionally]
12 //~| HELP use the named argument by name to avoid ambiguity
13 println
!("first positional arg {}, second positional arg {}, _x is {}", 1, 2, y
= _x
);
14 //~^ WARNING named argument `y` is not used by name [named_arguments_used_positionally]
15 //~| HELP use the named argument by name to avoid ambiguity
19 let _f
= format
!("_x is {}", _x
= 5);
20 //~^ WARNING named argument `_x` is not used by name [named_arguments_used_positionally]
21 //~| HELP use the named argument by name to avoid ambiguity
22 let _f
= format
!("_x is {}", y
= _x
);
23 //~^ WARNING named argument `y` is not used by name [named_arguments_used_positionally]
24 //~| HELP use the named argument by name to avoid ambiguity
25 let _f
= format
!("first positional arg {}, second positional arg {}, _x is {}", 1, 2, y
= _x
);
26 //~^ WARNING named argument `y` is not used by name [named_arguments_used_positionally]
27 //~| HELP use the named argument by name to avoid ambiguity
30 // Confirm that named arguments used in formatting are correctly considered.
31 println
!(".{:0<width$}", s
, width
= _x
);
37 // Confirm that named arguments used in formatting are correctly considered.
39 "| {r:rw$?} | {ui:4?} | {v}",
46 // Confirm that named arguments used in formatting are correctly considered.
47 println
!("{:.a$}", "aaaaaaaaaaaaaaaaaa", a
= 4);
49 // Confirm that named arguments used in formatting are correctly considered.
50 println
!("{:._a$}", "aaaaaaaaaaaaaaaaaa", _a
= 4);