5 println!("{b} {}", a=1, b=2);
6 //~^ WARNING named argument `a` is not used by name [named_arguments_used_positionally]
7 //~| HELP use the named argument by name to avoid ambiguity
9 println!("{} {} {} {} {}", 0, a=1, b=2, c=3, d=4);
10 //~^ WARNING named argument `a` is not used by name [named_arguments_used_positionally]
11 //~| WARNING named argument `b` is not used by name [named_arguments_used_positionally]
12 //~| WARNING named argument `c` is not used by name [named_arguments_used_positionally]
13 //~| WARNING named argument `d` is not used by name [named_arguments_used_positionally]
14 //~| HELP use the named argument by name to avoid ambiguity
15 //~| HELP use the named argument by name to avoid ambiguity
16 //~| HELP use the named argument by name to avoid ambiguity
17 //~| HELP use the named argument by name to avoid ambiguity
19 println!("Hello {:1$}!", "x", width = 5);
20 //~^ WARNING named argument `width` is not used by name [named_arguments_used_positionally
21 //~| HELP use the named argument by name to avoid ambiguity
23 println!("Hello {:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
24 //~^ WARNING named argument `width` is not used by name [named_arguments_used_positionally
25 //~| WARNING named argument `precision` is not used by name [named_arguments_used_positionally]
26 //~| WARNING named argument `f` is not used by name [named_arguments_used_positionally]
27 //~| HELP use the named argument by name to avoid ambiguity
28 //~| HELP use the named argument by name to avoid ambiguity
29 //~| HELP use the named argument by name to avoid ambiguity
31 println!("Hello {0:1$.2$}!", f = 0.02f32, width = 5, precision = 2);
32 //~^ WARNING named argument `width` is not used by name [named_arguments_used_positionally
33 //~| WARNING named argument `precision` is not used by name [named_arguments_used_positionally]
34 //~| WARNING named argument `f` is not used by name [named_arguments_used_positionally]
35 //~| HELP use the named argument by name to avoid ambiguity
36 //~| HELP use the named argument by name to avoid ambiguity
37 //~| HELP use the named argument by name to avoid ambiguity
40 "{}, Hello {1:2$.3$} {4:5$.6$}! {1}",
41 //~^ HELP use the named argument by name to avoid ambiguity
42 //~| HELP use the named argument by name to avoid ambiguity
43 //~| HELP use the named argument by name to avoid ambiguity
44 //~| HELP use the named argument by name to avoid ambiguity
45 //~| HELP use the named argument by name to avoid ambiguity
46 //~| HELP use the named argument by name to avoid ambiguity
47 //~| HELP use the named argument by name to avoid ambiguity
50 //~^ WARNING named argument `f` is not used by name [named_arguments_used_positionally]
51 //~| WARNING named argument `f` is not used by name [named_arguments_used_positionally]
53 //~^ WARNING named argument `width` is not used by name [named_arguments_used_positionally
55 //~^ WARNING named argument `precision` is not used by name [named_arguments_used_positionally]
57 //~^ WARNING named argument `g` is not used by name [named_arguments_used_positionally]
59 //~^ WARNING named argument `width2` is not used by name [named_arguments_used_positionally
61 //~^ WARNING named argument `precision2` is not used by name [named_arguments_used_positionally]
64 println!("Hello {:0.1}!", f = 0.02f32);
65 //~^ WARNING named argument `f` is not used by name [named_arguments_used_positionally]
66 //~| HELP use the named argument by name to avoid ambiguity
68 println!("Hello {0:0.1}!", f = 0.02f32);
69 //~^ WARNING named argument `f` is not used by name [named_arguments_used_positionally]
70 //~| HELP use the named argument by name to avoid ambiguity
72 println!("Hello {f:width$.precision$}!", f = 0.02f32, width = 5, precision = 2);
76 println!("Hello {f:width$.precision$}!", f = 0.02f32);
79 println!("{:0$}", v = val);
80 //~^ WARNING named argument `v` is not used by name [named_arguments_used_positionally]
81 //~| WARNING named argument `v` is not used by name [named_arguments_used_positionally]
82 //~| HELP use the named argument by name to avoid ambiguity
83 //~| HELP use the named argument by name to avoid ambiguity
84 println!("{0:0$}", v = val);
85 //~^ WARNING named argument `v` is not used by name [named_arguments_used_positionally]
86 //~| WARNING named argument `v` is not used by name [named_arguments_used_positionally]
87 //~| HELP use the named argument by name to avoid ambiguity
88 //~| HELP use the named argument by name to avoid ambiguity
89 println!("{:0$.0$}", v = val);
90 //~^ WARNING named argument `v` is not used by name [named_arguments_used_positionally]
91 //~| WARNING named argument `v` is not used by name [named_arguments_used_positionally]
92 //~| WARNING named argument `v` is not used by name [named_arguments_used_positionally]
93 //~| HELP use the named argument by name to avoid ambiguity
94 //~| HELP use the named argument by name to avoid ambiguity
95 //~| HELP use the named argument by name to avoid ambiguity
96 println!("{0:0$.0$}", v = val);
97 //~^ WARNING named argument `v` is not used by name [named_arguments_used_positionally]
98 //~| WARNING named argument `v` is not used by name [named_arguments_used_positionally]
99 //~| WARNING named argument `v` is not used by name [named_arguments_used_positionally]
100 //~| HELP use the named argument by name to avoid ambiguity
101 //~| HELP use the named argument by name to avoid ambiguity
102 //~| HELP use the named argument by name to avoid ambiguity
104 println!("{} {a} {0}", a = 1);
105 //~^ WARNING named argument `a` is not used by name [named_arguments_used_positionally]
106 //~| WARNING named argument `a` is not used by name [named_arguments_used_positionally]
107 //~| HELP use the named argument by name to avoid ambiguity
108 //~| HELP use the named argument by name to avoid ambiguity
110 println!("aaaaaaaaaaaaaaa\
112 //~^ HELP use the named argument by name to avoid ambiguity
113 //~| HELP use the named argument by name to avoid ambiguity
114 //~| HELP use the named argument by name to avoid ambiguity
115 a = 1.0, b = 1, c = 2,
116 //~^ WARNING named argument `a` is not used by name [named_arguments_used_positionally]
117 //~| WARNING named argument `b` is not used by name [named_arguments_used_positionally]
118 //~| WARNING named argument `c` is not used by name [named_arguments_used_positionally]
121 println!("aaaaaaaaaaaaaaa\
123 //~^ HELP use the named argument by name to avoid ambiguity
124 //~| HELP use the named argument by name to avoid ambiguity
125 //~| HELP use the named argument by name to avoid ambiguity
126 a = 1.0, b = 1, c = 2,
127 //~^ WARNING named argument `a` is not used by name [named_arguments_used_positionally]
128 //~| WARNING named argument `b` is not used by name [named_arguments_used_positionally]
129 //~| WARNING named argument `c` is not used by name [named_arguments_used_positionally]
132 println!("{{{:1$.2$}}}", x = 1.0, width = 3, precision = 2);
133 //~^ WARNING named argument `x` is not used by name [named_arguments_used_positionally]
134 //~| WARNING named argument `width` is not used by name [named_arguments_used_positionally]
135 //~| WARNING named argument `precision` is not used by name [named_arguments_used_positionally]
136 //~| HELP use the named argument by name to avoid ambiguity
137 //~| HELP use the named argument by name to avoid ambiguity
138 //~| HELP use the named argument by name to avoid ambiguity