Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4718cb4

Browse files
committedFeb 5, 2025·
When displaying a parameter mismatch error, only highlight the mismatched parameters when showing the definition.
1 parent 820bfff commit 4718cb4

28 files changed

+246
-312
lines changed
 

‎compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 155 additions & 161 deletions
Large diffs are not rendered by default.

‎tests/ui/argument-suggestions/basic.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ note: function defined here
5757
--> $DIR/basic.rs:16:4
5858
|
5959
LL | fn swapped(_i: u32, _s: &str) {}
60-
| ^^^^^^^ ------- --------
60+
| ^^^^^^^
6161
help: swap these arguments
6262
|
6363
LL | swapped(1, "");
@@ -76,7 +76,7 @@ note: function defined here
7676
--> $DIR/basic.rs:17:4
7777
|
7878
LL | fn permuted(_x: X, _y: Y, _z: Z) {}
79-
| ^^^^^^^^ ----- ----- -----
79+
| ^^^^^^^^
8080
help: reorder these arguments
8181
|
8282
LL | permuted(X {}, Y {}, Z {});

‎tests/ui/argument-suggestions/complex.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ note: function defined here
88
--> $DIR/complex.rs:11:4
99
|
1010
LL | fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {}
11-
| ^^^^^^^ ------- -------- ----- ----- ----- ----- ----- -----
11+
| ^^^^^^^ ------- -----
1212
help: did you mean
1313
|
1414
LL | complex(/* u32 */, &"", /* E */, F::X2, G{}, X {}, Y {}, Z {});

‎tests/ui/argument-suggestions/extra_arguments.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ note: function defined here
4444
--> $DIR/extra_arguments.rs:2:4
4545
|
4646
LL | fn one_arg<T>(_a: T) {}
47-
| ^^^^^^^ -----
47+
| ^^^^^^^
4848
help: remove the extra argument
4949
|
5050
LL - one_arg(1, 1);
@@ -61,7 +61,7 @@ note: function defined here
6161
--> $DIR/extra_arguments.rs:2:4
6262
|
6363
LL | fn one_arg<T>(_a: T) {}
64-
| ^^^^^^^ -----
64+
| ^^^^^^^
6565
help: remove the extra argument
6666
|
6767
LL - one_arg(1, "");
@@ -80,7 +80,7 @@ note: function defined here
8080
--> $DIR/extra_arguments.rs:2:4
8181
|
8282
LL | fn one_arg<T>(_a: T) {}
83-
| ^^^^^^^ -----
83+
| ^^^^^^^
8484
help: remove the extra arguments
8585
|
8686
LL - one_arg(1, "", 1.0);
@@ -97,7 +97,7 @@ note: function defined here
9797
--> $DIR/extra_arguments.rs:3:4
9898
|
9999
LL | fn two_arg_same(_a: i32, _b: i32) {}
100-
| ^^^^^^^^^^^^ ------- -------
100+
| ^^^^^^^^^^^^
101101
help: remove the extra argument
102102
|
103103
LL - two_arg_same(1, 1, 1);
@@ -114,7 +114,7 @@ note: function defined here
114114
--> $DIR/extra_arguments.rs:3:4
115115
|
116116
LL | fn two_arg_same(_a: i32, _b: i32) {}
117-
| ^^^^^^^^^^^^ ------- -------
117+
| ^^^^^^^^^^^^
118118
help: remove the extra argument
119119
|
120120
LL - two_arg_same(1, 1, 1.0);
@@ -131,7 +131,7 @@ note: function defined here
131131
--> $DIR/extra_arguments.rs:4:4
132132
|
133133
LL | fn two_arg_diff(_a: i32, _b: &str) {}
134-
| ^^^^^^^^^^^^ ------- --------
134+
| ^^^^^^^^^^^^
135135
help: remove the extra argument
136136
|
137137
LL - two_arg_diff(1, 1, "");
@@ -148,7 +148,7 @@ note: function defined here
148148
--> $DIR/extra_arguments.rs:4:4
149149
|
150150
LL | fn two_arg_diff(_a: i32, _b: &str) {}
151-
| ^^^^^^^^^^^^ ------- --------
151+
| ^^^^^^^^^^^^
152152
help: remove the extra argument
153153
|
154154
LL - two_arg_diff(1, "", "");
@@ -167,7 +167,7 @@ note: function defined here
167167
--> $DIR/extra_arguments.rs:4:4
168168
|
169169
LL | fn two_arg_diff(_a: i32, _b: &str) {}
170-
| ^^^^^^^^^^^^ ------- --------
170+
| ^^^^^^^^^^^^
171171
help: remove the extra arguments
172172
|
173173
LL - two_arg_diff(1, 1, "", "");
@@ -186,7 +186,7 @@ note: function defined here
186186
--> $DIR/extra_arguments.rs:4:4
187187
|
188188
LL | fn two_arg_diff(_a: i32, _b: &str) {}
189-
| ^^^^^^^^^^^^ ------- --------
189+
| ^^^^^^^^^^^^
190190
help: remove the extra arguments
191191
|
192192
LL - two_arg_diff(1, "", 1, "");
@@ -203,7 +203,7 @@ note: function defined here
203203
--> $DIR/extra_arguments.rs:3:4
204204
|
205205
LL | fn two_arg_same(_a: i32, _b: i32) {}
206-
| ^^^^^^^^^^^^ ------- -------
206+
| ^^^^^^^^^^^^
207207
help: remove the extra argument
208208
|
209209
LL - two_arg_same(1, 1, "");
@@ -220,7 +220,7 @@ note: function defined here
220220
--> $DIR/extra_arguments.rs:4:4
221221
|
222222
LL | fn two_arg_diff(_a: i32, _b: &str) {}
223-
| ^^^^^^^^^^^^ ------- --------
223+
| ^^^^^^^^^^^^
224224
help: remove the extra argument
225225
|
226226
LL - two_arg_diff(1, 1, "");
@@ -240,7 +240,7 @@ note: function defined here
240240
--> $DIR/extra_arguments.rs:3:4
241241
|
242242
LL | fn two_arg_same(_a: i32, _b: i32) {}
243-
| ^^^^^^^^^^^^ ------- -------
243+
| ^^^^^^^^^^^^
244244
help: remove the extra argument
245245
|
246246
LL - 1,
@@ -261,7 +261,7 @@ note: function defined here
261261
--> $DIR/extra_arguments.rs:4:4
262262
|
263263
LL | fn two_arg_diff(_a: i32, _b: &str) {}
264-
| ^^^^^^^^^^^^ ------- --------
264+
| ^^^^^^^^^^^^
265265
help: remove the extra argument
266266
|
267267
LL - 1,
@@ -335,7 +335,7 @@ note: function defined here
335335
--> $DIR/extra_arguments.rs:2:4
336336
|
337337
LL | fn one_arg<T>(_a: T) {}
338-
| ^^^^^^^ -----
338+
| ^^^^^^^
339339
help: remove the extra argument
340340
|
341341
LL - one_arg(1, panic!());
@@ -352,7 +352,7 @@ note: function defined here
352352
--> $DIR/extra_arguments.rs:2:4
353353
|
354354
LL | fn one_arg<T>(_a: T) {}
355-
| ^^^^^^^ -----
355+
| ^^^^^^^
356356
help: remove the extra argument
357357
|
358358
LL - one_arg(panic!(), 1);
@@ -369,7 +369,7 @@ note: function defined here
369369
--> $DIR/extra_arguments.rs:2:4
370370
|
371371
LL | fn one_arg<T>(_a: T) {}
372-
| ^^^^^^^ -----
372+
| ^^^^^^^
373373
help: remove the extra argument
374374
|
375375
LL - one_arg(stringify!($e), 1);
@@ -386,7 +386,7 @@ note: function defined here
386386
--> $DIR/extra_arguments.rs:2:4
387387
|
388388
LL | fn one_arg<T>(_a: T) {}
389-
| ^^^^^^^ -----
389+
| ^^^^^^^
390390
help: remove the extra argument
391391
|
392392
LL - one_arg(for _ in 1.. {}, 1);

‎tests/ui/argument-suggestions/invalid_arguments.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ note: function defined here
150150
--> $DIR/invalid_arguments.rs:8:4
151151
|
152152
LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
153-
| ^^^^^^^^^^^^^^ ------- ------- --------
153+
| ^^^^^^^^^^^^^^ ------- -------
154154

155155
error[E0308]: arguments to this function are incorrect
156156
--> $DIR/invalid_arguments.rs:29:3
@@ -164,7 +164,7 @@ note: function defined here
164164
--> $DIR/invalid_arguments.rs:8:4
165165
|
166166
LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
167-
| ^^^^^^^^^^^^^^ ------- ------- --------
167+
| ^^^^^^^^^^^^^^ ------- --------
168168

169169
error[E0308]: arguments to this function are incorrect
170170
--> $DIR/invalid_arguments.rs:30:3
@@ -178,7 +178,7 @@ note: function defined here
178178
--> $DIR/invalid_arguments.rs:8:4
179179
|
180180
LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
181-
| ^^^^^^^^^^^^^^ ------- ------- --------
181+
| ^^^^^^^^^^^^^^ ------- --------
182182

183183
error[E0308]: arguments to this function are incorrect
184184
--> $DIR/invalid_arguments.rs:32:3
@@ -249,7 +249,7 @@ note: function defined here
249249
--> $DIR/invalid_arguments.rs:9:4
250250
|
251251
LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
252-
| ^^^^^^^^^^^^^^^^ ------- ------- --------
252+
| ^^^^^^^^^^^^^^^^ ------- -------
253253

254254
error[E0308]: arguments to this function are incorrect
255255
--> $DIR/invalid_arguments.rs:39:3
@@ -263,7 +263,7 @@ note: function defined here
263263
--> $DIR/invalid_arguments.rs:9:4
264264
|
265265
LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
266-
| ^^^^^^^^^^^^^^^^ ------- ------- --------
266+
| ^^^^^^^^^^^^^^^^ ------- --------
267267

268268
error[E0308]: arguments to this function are incorrect
269269
--> $DIR/invalid_arguments.rs:40:3
@@ -277,7 +277,7 @@ note: function defined here
277277
--> $DIR/invalid_arguments.rs:9:4
278278
|
279279
LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
280-
| ^^^^^^^^^^^^^^^^ ------- ------- --------
280+
| ^^^^^^^^^^^^^^^^ ------- --------
281281

282282
error[E0308]: arguments to this function are incorrect
283283
--> $DIR/invalid_arguments.rs:42:3

‎tests/ui/argument-suggestions/issue-100478.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: function defined here
1111
--> $DIR/issue-100478.rs:30:4
1212
|
1313
LL | fn three_diff(_a: T1, _b: T2, _c: T3) {}
14-
| ^^^^^^^^^^ ------ ------ ------
14+
| ^^^^^^^^^^ ------ ------
1515
help: provide the arguments
1616
|
1717
LL | three_diff(/* T1 */, T2::new(0), /* T3 */);
@@ -31,7 +31,7 @@ note: function defined here
3131
--> $DIR/issue-100478.rs:31:4
3232
|
3333
LL | fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {}
34-
| ^^^^^^^^^^^^ ------ ------ ------ ------
34+
| ^^^^^^^^^^^^
3535
help: did you mean
3636
|
3737
LL | four_shuffle(T1::default(), T2::default(), T3::default(), T4::default());
@@ -50,7 +50,7 @@ note: function defined here
5050
--> $DIR/issue-100478.rs:31:4
5151
|
5252
LL | fn four_shuffle(_a: T1, _b: T2, _c: T3, _d: T4) {}
53-
| ^^^^^^^^^^^^ ------ ------ ------ ------
53+
| ^^^^^^^^^^^^ ------
5454
help: swap these arguments
5555
|
5656
LL | four_shuffle(T1::default(), T2::default(), T3::default(), /* T4 */);
@@ -69,7 +69,7 @@ note: function defined here
6969
--> $DIR/issue-100478.rs:29:4
7070
|
7171
LL | fn foo(p1: T1, p2: Arc<T2>, p3: T3, p4: Arc<T4>, p5: T5, p6: T6, p7: T7, p8: Arc<T8>) {}
72-
| ^^^ ------ ----------- ------ ----------- ------ ------ ------ -----------
72+
| ^^^ -----------
7373
help: provide the argument
7474
|
7575
LL | foo(p1, /* Arc<T2> */, p3, p4, p5, p6, p7, p8);

‎tests/ui/argument-suggestions/issue-101097.stderr

Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,6 @@ note: function defined here
1313
|
1414
LL | fn f(
1515
| ^
16-
LL | a1: A,
17-
| -----
18-
LL | a2: A,
19-
| -----
20-
LL | b1: B,
21-
| -----
22-
LL | b2: B,
23-
| -----
24-
LL | c1: C,
25-
| -----
26-
LL | c2: C,
27-
| -----
2816
help: did you mean
2917
|
3018
LL | f(A, A, B, B, C, C);
@@ -41,18 +29,6 @@ note: function defined here
4129
|
4230
LL | fn f(
4331
| ^
44-
LL | a1: A,
45-
| -----
46-
LL | a2: A,
47-
| -----
48-
LL | b1: B,
49-
| -----
50-
LL | b2: B,
51-
| -----
52-
LL | c1: C,
53-
| -----
54-
LL | c2: C,
55-
| -----
5632
help: did you mean
5733
|
5834
LL | f(A, A, B, B, C, C);
@@ -72,14 +48,7 @@ note: function defined here
7248
|
7349
LL | fn f(
7450
| ^
75-
LL | a1: A,
76-
| -----
77-
LL | a2: A,
78-
| -----
79-
LL | b1: B,
80-
| -----
81-
LL | b2: B,
82-
| -----
51+
...
8352
LL | c1: C,
8453
| -----
8554
LL | c2: C,
@@ -104,18 +73,6 @@ note: function defined here
10473
|
10574
LL | fn f(
10675
| ^
107-
LL | a1: A,
108-
| -----
109-
LL | a2: A,
110-
| -----
111-
LL | b1: B,
112-
| -----
113-
LL | b2: B,
114-
| -----
115-
LL | c1: C,
116-
| -----
117-
LL | c2: C,
118-
| -----
11976
help: did you mean
12077
|
12178
LL | f(A, A, B, B, C, C);
@@ -137,18 +94,9 @@ note: function defined here
13794
|
13895
LL | fn f(
13996
| ^
140-
LL | a1: A,
141-
| -----
142-
LL | a2: A,
143-
| -----
97+
...
14498
LL | b1: B,
14599
| -----
146-
LL | b2: B,
147-
| -----
148-
LL | c1: C,
149-
| -----
150-
LL | c2: C,
151-
| -----
152100
help: did you mean
153101
|
154102
LL | f(A, A, /* B */, B, C, C);

‎tests/ui/argument-suggestions/issue-109425.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ note: function defined here
2929
--> $DIR/issue-109425.rs:4:4
3030
|
3131
LL | fn i(_: u32) {}
32-
| ^ ------
32+
| ^
3333
help: remove the extra arguments
3434
|
3535
LL - i(0, 1, 2,); // i(0,)
@@ -48,7 +48,7 @@ note: function defined here
4848
--> $DIR/issue-109425.rs:4:4
4949
|
5050
LL | fn i(_: u32) {}
51-
| ^ ------
51+
| ^
5252
help: remove the extra arguments
5353
|
5454
LL - i(0, 1, 2); // i(0)
@@ -67,7 +67,7 @@ note: function defined here
6767
--> $DIR/issue-109425.rs:5:4
6868
|
6969
LL | fn is(_: u32, _: &str) {}
70-
| ^^ ------ -------
70+
| ^^
7171
help: remove the extra arguments
7272
|
7373
LL - is(0, 1, 2, ""); // is(0, "")
@@ -86,7 +86,7 @@ note: function defined here
8686
--> $DIR/issue-109425.rs:5:4
8787
|
8888
LL | fn is(_: u32, _: &str) {}
89-
| ^^ ------ -------
89+
| ^^
9090
help: remove the extra arguments
9191
|
9292
LL - is((), 1, "", ());
@@ -105,7 +105,7 @@ note: function defined here
105105
--> $DIR/issue-109425.rs:5:4
106106
|
107107
LL | fn is(_: u32, _: &str) {}
108-
| ^^ ------ -------
108+
| ^^
109109
help: remove the extra arguments
110110
|
111111
LL - is(1, (), "", ());
@@ -124,7 +124,7 @@ note: function defined here
124124
--> $DIR/issue-109425.rs:6:4
125125
|
126126
LL | fn s(_: &str) {}
127-
| ^ -------
127+
| ^
128128
help: remove the extra arguments
129129
|
130130
LL - s(0, 1, ""); // s("")

‎tests/ui/argument-suggestions/issue-109831.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ note: function defined here
3838
--> $DIR/issue-109831.rs:4:4
3939
|
4040
LL | fn f(b1: B, b2: B, a2: C) {}
41-
| ^ ----- ----- -----
41+
| ^ ----- -----
4242
help: remove the extra argument
4343
|
4444
LL - f(A, A, B, C);

‎tests/ui/argument-suggestions/issue-96638.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: function defined here
1010
--> $DIR/issue-96638.rs:1:4
1111
|
1212
LL | fn f(_: usize, _: &usize, _: usize) {}
13-
| ^ -------- --------- --------
13+
| ^ -------- --------
1414
help: provide the argument
1515
|
1616
LL | f(/* usize */, &x, /* usize */);

‎tests/ui/argument-suggestions/issue-97197.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ note: function defined here
88
--> $DIR/issue-97197.rs:6:8
99
|
1010
LL | pub fn g(a1: (), a2: bool, a3: bool, a4: bool, a5: bool, a6: ()) -> () {}
11-
| ^ ------ -------- -------- -------- -------- ------
11+
| ^ -------- -------- -------- --------
1212
help: provide the arguments
1313
|
1414
LL | g((), /* bool */, /* bool */, /* bool */, /* bool */, ());

‎tests/ui/argument-suggestions/issue-97484.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ note: function defined here
1212
--> $DIR/issue-97484.rs:9:4
1313
|
1414
LL | fn foo(a: &A, d: D, e: &E, g: G) {}
15-
| ^^^ ----- ---- ----- ----
15+
| ^^^ -----
1616
help: consider borrowing here
1717
|
1818
LL | foo(&&A, B, C, D, &E, F, G);

‎tests/ui/argument-suggestions/missing_arguments.stderr

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ note: function defined here
4040
--> $DIR/missing_arguments.rs:2:4
4141
|
4242
LL | fn two_same(_a: i32, _b: i32) {}
43-
| ^^^^^^^^ ------- -------
43+
| ^^^^^^^^ -------
4444
help: provide the argument
4545
|
4646
LL | two_same(1, /* i32 */);
@@ -72,7 +72,7 @@ note: function defined here
7272
--> $DIR/missing_arguments.rs:3:4
7373
|
7474
LL | fn two_diff(_a: i32, _b: f32) {}
75-
| ^^^^^^^^ ------- -------
75+
| ^^^^^^^^ -------
7676
help: provide the argument
7777
|
7878
LL | two_diff(1, /* f32 */);
@@ -88,7 +88,7 @@ note: function defined here
8888
--> $DIR/missing_arguments.rs:3:4
8989
|
9090
LL | fn two_diff(_a: i32, _b: f32) {}
91-
| ^^^^^^^^ ------- -------
91+
| ^^^^^^^^ -------
9292
help: provide the argument
9393
|
9494
LL | two_diff(/* i32 */, 1.0);
@@ -120,7 +120,7 @@ note: function defined here
120120
--> $DIR/missing_arguments.rs:4:4
121121
|
122122
LL | fn three_same(_a: i32, _b: i32, _c: i32) {}
123-
| ^^^^^^^^^^ ------- ------- -------
123+
| ^^^^^^^^^^ ------- -------
124124
help: provide the arguments
125125
|
126126
LL | three_same(1, /* i32 */, /* i32 */);
@@ -136,7 +136,7 @@ note: function defined here
136136
--> $DIR/missing_arguments.rs:4:4
137137
|
138138
LL | fn three_same(_a: i32, _b: i32, _c: i32) {}
139-
| ^^^^^^^^^^ ------- ------- -------
139+
| ^^^^^^^^^^ -------
140140
help: provide the argument
141141
|
142142
LL | three_same(1, 1, /* i32 */);
@@ -152,7 +152,7 @@ note: function defined here
152152
--> $DIR/missing_arguments.rs:5:4
153153
|
154154
LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
155-
| ^^^^^^^^^^ ------- ------- --------
155+
| ^^^^^^^^^^ -------
156156
help: provide the argument
157157
|
158158
LL | three_diff(/* i32 */, 1.0, "");
@@ -168,7 +168,7 @@ note: function defined here
168168
--> $DIR/missing_arguments.rs:5:4
169169
|
170170
LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
171-
| ^^^^^^^^^^ ------- ------- --------
171+
| ^^^^^^^^^^ -------
172172
help: provide the argument
173173
|
174174
LL | three_diff(1, /* f32 */, "");
@@ -184,7 +184,7 @@ note: function defined here
184184
--> $DIR/missing_arguments.rs:5:4
185185
|
186186
LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
187-
| ^^^^^^^^^^ ------- ------- --------
187+
| ^^^^^^^^^^ --------
188188
help: provide the argument
189189
|
190190
LL | three_diff(1, 1.0, /* &str */);
@@ -200,7 +200,7 @@ note: function defined here
200200
--> $DIR/missing_arguments.rs:5:4
201201
|
202202
LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
203-
| ^^^^^^^^^^ ------- ------- --------
203+
| ^^^^^^^^^^ ------- -------
204204
help: provide the arguments
205205
|
206206
LL | three_diff(/* i32 */, /* f32 */, "");
@@ -219,7 +219,7 @@ note: function defined here
219219
--> $DIR/missing_arguments.rs:5:4
220220
|
221221
LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
222-
| ^^^^^^^^^^ ------- ------- --------
222+
| ^^^^^^^^^^ ------- --------
223223
help: provide the arguments
224224
|
225225
LL | three_diff(/* i32 */, 1.0, /* &str */);
@@ -235,7 +235,7 @@ note: function defined here
235235
--> $DIR/missing_arguments.rs:5:4
236236
|
237237
LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
238-
| ^^^^^^^^^^ ------- ------- --------
238+
| ^^^^^^^^^^ ------- --------
239239
help: provide the arguments
240240
|
241241
LL | three_diff(1, /* f32 */, /* &str */);
@@ -267,7 +267,7 @@ note: function defined here
267267
--> $DIR/missing_arguments.rs:6:4
268268
|
269269
LL | fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {}
270-
| ^^^^^^^^^^^^^ ------- ------- ------- --------
270+
| ^^^^^^^^^^^^^ ------- -------
271271
help: provide the arguments
272272
|
273273
LL | four_repeated(1, /* f32 */, /* f32 */, "");
@@ -299,7 +299,7 @@ note: function defined here
299299
--> $DIR/missing_arguments.rs:7:4
300300
|
301301
LL | fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {}
302-
| ^^^^^^^ ------- ------- ------- ------- --------
302+
| ^^^^^^^ ------- ------- -------
303303
help: provide the arguments
304304
|
305305
LL | complex(1, /* f32 */, /* i32 */, /* f32 */, "");

‎tests/ui/argument-suggestions/mixed_cases.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: function defined here
1010
--> $DIR/mixed_cases.rs:5:4
1111
|
1212
LL | fn two_args(_a: i32, _b: f32) {}
13-
| ^^^^^^^^ ------- -------
13+
| ^^^^^^^^ -------
1414
help: remove the extra argument
1515
|
1616
LL - two_args(1, "", X {});
@@ -30,7 +30,7 @@ note: function defined here
3030
--> $DIR/mixed_cases.rs:6:4
3131
|
3232
LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
33-
| ^^^^^^^^^^ ------- ------- --------
33+
| ^^^^^^^^^^ -------
3434
help: did you mean
3535
|
3636
LL | three_args(1, /* f32 */, "");
@@ -49,7 +49,7 @@ note: function defined here
4949
--> $DIR/mixed_cases.rs:6:4
5050
|
5151
LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
52-
| ^^^^^^^^^^ ------- ------- --------
52+
| ^^^^^^^^^^ ------- --------
5353
help: provide the argument
5454
|
5555
LL | three_args(1, /* f32 */, /* &str */);
@@ -67,7 +67,7 @@ note: function defined here
6767
--> $DIR/mixed_cases.rs:6:4
6868
|
6969
LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
70-
| ^^^^^^^^^^ ------- ------- --------
70+
| ^^^^^^^^^^ -------
7171
help: did you mean
7272
|
7373
LL | three_args(1, /* f32 */, "");
@@ -86,7 +86,7 @@ note: function defined here
8686
--> $DIR/mixed_cases.rs:6:4
8787
|
8888
LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
89-
| ^^^^^^^^^^ ------- ------- --------
89+
| ^^^^^^^^^^ -------
9090
help: swap these arguments
9191
|
9292
LL | three_args(1, /* f32 */, "");
@@ -106,7 +106,7 @@ note: function defined here
106106
--> $DIR/mixed_cases.rs:6:4
107107
|
108108
LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
109-
| ^^^^^^^^^^ ------- ------- --------
109+
| ^^^^^^^^^^ -------
110110
help: did you mean
111111
|
112112
LL | three_args(1, /* f32 */, "");

‎tests/ui/argument-suggestions/permuted_arguments.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ note: function defined here
1111
--> $DIR/permuted_arguments.rs:5:4
1212
|
1313
LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
14-
| ^^^^^^^^^^ ------- ------- --------
14+
| ^^^^^^^^^^
1515
help: reorder these arguments
1616
|
1717
LL | three_args(1, 1.0, "");
@@ -32,7 +32,7 @@ note: function defined here
3232
--> $DIR/permuted_arguments.rs:6:4
3333
|
3434
LL | fn many_args(_a: i32, _b: f32, _c: &str, _d: X, _e: Y) {}
35-
| ^^^^^^^^^ ------- ------- -------- ----- -----
35+
| ^^^^^^^^^
3636
help: reorder these arguments
3737
|
3838
LL | many_args(1, 1.0, "", X {}, Y {});

‎tests/ui/argument-suggestions/suggest-better-removing-issue-126246.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ note: function defined here
3838
--> $DIR/suggest-better-removing-issue-126246.rs:1:4
3939
|
4040
LL | fn add_one(x: i32) -> i32 {
41-
| ^^^^^^^ ------
41+
| ^^^^^^^
4242
help: remove the extra argument
4343
|
4444
LL - add_one(2, 2);
@@ -55,7 +55,7 @@ note: function defined here
5555
--> $DIR/suggest-better-removing-issue-126246.rs:1:4
5656
|
5757
LL | fn add_one(x: i32) -> i32 {
58-
| ^^^^^^^ ------
58+
| ^^^^^^^
5959
help: remove the extra argument
6060
|
6161
LL - add_one(no_such_local, 10);
@@ -72,7 +72,7 @@ note: function defined here
7272
--> $DIR/suggest-better-removing-issue-126246.rs:1:4
7373
|
7474
LL | fn add_one(x: i32) -> i32 {
75-
| ^^^^^^^ ------
75+
| ^^^^^^^
7676
help: remove the extra argument
7777
|
7878
LL - add_one(10, no_such_local);
@@ -89,7 +89,7 @@ note: function defined here
8989
--> $DIR/suggest-better-removing-issue-126246.rs:5:4
9090
|
9191
LL | fn add_two(x: i32, y: i32) -> i32 {
92-
| ^^^^^^^ ------ ------
92+
| ^^^^^^^
9393
help: remove the extra argument
9494
|
9595
LL - add_two(10, no_such_local, 10);
@@ -106,7 +106,7 @@ note: function defined here
106106
--> $DIR/suggest-better-removing-issue-126246.rs:5:4
107107
|
108108
LL | fn add_two(x: i32, y: i32) -> i32 {
109-
| ^^^^^^^ ------ ------
109+
| ^^^^^^^
110110
help: remove the extra argument
111111
|
112112
LL - add_two(no_such_local, 10, 10);
@@ -123,7 +123,7 @@ note: function defined here
123123
--> $DIR/suggest-better-removing-issue-126246.rs:5:4
124124
|
125125
LL | fn add_two(x: i32, y: i32) -> i32 {
126-
| ^^^^^^^ ------ ------
126+
| ^^^^^^^
127127
help: remove the extra argument
128128
|
129129
LL - add_two(10, 10, no_such_local);

‎tests/ui/argument-suggestions/swapped_arguments.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: function defined here
1010
--> $DIR/swapped_arguments.rs:3:4
1111
|
1212
LL | fn two_args(_a: i32, _b: f32) {}
13-
| ^^^^^^^^ ------- -------
13+
| ^^^^^^^^
1414
help: swap these arguments
1515
|
1616
LL | two_args(1, 1.0);
@@ -28,7 +28,7 @@ note: function defined here
2828
--> $DIR/swapped_arguments.rs:4:4
2929
|
3030
LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
31-
| ^^^^^^^^^^ ------- ------- --------
31+
| ^^^^^^^^^^
3232
help: swap these arguments
3333
|
3434
LL | three_args(1, 1.0, "");
@@ -46,7 +46,7 @@ note: function defined here
4646
--> $DIR/swapped_arguments.rs:4:4
4747
|
4848
LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
49-
| ^^^^^^^^^^ ------- ------- --------
49+
| ^^^^^^^^^^
5050
help: swap these arguments
5151
|
5252
LL | three_args(1, 1.0, "");
@@ -64,7 +64,7 @@ note: function defined here
6464
--> $DIR/swapped_arguments.rs:4:4
6565
|
6666
LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
67-
| ^^^^^^^^^^ ------- ------- --------
67+
| ^^^^^^^^^^
6868
help: swap these arguments
6969
|
7070
LL | three_args(1, 1.0, "");
@@ -84,7 +84,7 @@ note: function defined here
8484
--> $DIR/swapped_arguments.rs:5:4
8585
|
8686
LL | fn four_args(_a: i32, _b: f32, _c: &str, _d: X) {}
87-
| ^^^^^^^^^ ------- ------- -------- -----
87+
| ^^^^^^^^^
8888
help: did you mean
8989
|
9090
LL | four_args(1, 1.0, "", X {});

‎tests/ui/error-codes/E0061.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ note: function defined here
88
--> $DIR/E0061.rs:1:4
99
|
1010
LL | fn f(a: u16, b: &str) {}
11-
| ^ ------ -------
11+
| ^ -------
1212
help: provide the argument
1313
|
1414
LL | f(0, /* &str */);

‎tests/ui/issues/issue-4935.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ note: function defined here
88
--> $DIR/issue-4935.rs:3:4
99
|
1010
LL | fn foo(a: usize) {}
11-
| ^^^ --------
11+
| ^^^
1212
help: remove the extra argument
1313
|
1414
LL - fn main() { foo(5, 6) }

‎tests/ui/methods/method-call-err-msg.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ note: method defined here
4141
--> $DIR/method-call-err-msg.rs:7:8
4242
|
4343
LL | fn two(self, _: isize, _: isize) -> Foo { self }
44-
| ^^^ -------- --------
44+
| ^^^ --------
4545
help: provide the argument
4646
|
4747
LL | .two(0, /* isize */);

‎tests/ui/mismatched_types/generic-mismatch-reporting-issue-116615.stderr

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ note: function defined here
3131
--> $DIR/generic-mismatch-reporting-issue-116615.rs:2:4
3232
|
3333
LL | fn foo_multi_same<T>(a: T, b: T, c: T, d: T, e: T, f: i32) {}
34-
| ^^^^^^^^^^^^^^ - ---- ---- ---- ---- ---- ------
35-
| | | | | | |
36-
| | | | | | this parameter needs to match the `&str` type of `a` and `b`
34+
| ^^^^^^^^^^^^^^ - ---- ---- ---- ---- ---- this parameter needs to match the `&str` type of `a` and `b`
35+
| | | | | |
3736
| | | | | this parameter needs to match the `&str` type of `a` and `b`
3837
| | | | this parameter needs to match the `&str` type of `a` and `b`
3938
| | | `c`, `d` and `e` need to match the `&str` type of this parameter
@@ -83,9 +82,8 @@ note: function defined here
8382
--> $DIR/generic-mismatch-reporting-issue-116615.rs:2:4
8483
|
8584
LL | fn foo_multi_same<T>(a: T, b: T, c: T, d: T, e: T, f: i32) {}
86-
| ^^^^^^^^^^^^^^ - ---- ---- ---- ---- ---- ------
87-
| | | | | | |
88-
| | | | | | `b` and `c` need to match the `&str` type of this parameter
85+
| ^^^^^^^^^^^^^^ - ---- ---- ---- ---- ---- `b` and `c` need to match the `&str` type of this parameter
86+
| | | | | |
8987
| | | | | `b` and `c` need to match the `&str` type of this parameter
9088
| | | | this parameter needs to match the `&str` type of `a`, `d` and `e`
9189
| | | this parameter needs to match the `&str` type of `a`, `d` and `e`

‎tests/ui/not-enough-arguments.stderr

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ note: function defined here
88
--> $DIR/not-enough-arguments.rs:5:4
99
|
1010
LL | fn foo(a: isize, b: isize, c: isize, d:isize) {
11-
| ^^^ -------- -------- -------- -------
11+
| ^^^ -------
1212
help: provide the argument
1313
|
1414
LL | foo(1, 2, 3, /* isize */);
@@ -25,12 +25,7 @@ note: function defined here
2525
|
2626
LL | fn bar(
2727
| ^^^
28-
LL | a: i32,
29-
| ------
30-
LL | b: i32,
31-
| ------
32-
LL | c: i32,
33-
| ------
28+
...
3429
LL | d: i32,
3530
| ------
3631
LL | e: i32,

‎tests/ui/span/issue-34264.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ note: function defined here
6060
--> $DIR/issue-34264.rs:1:4
6161
|
6262
LL | fn foo(Option<i32>, String) {}
63-
| ^^^ ----------- ------
63+
| ^^^
6464
help: remove the extra argument
6565
|
6666
LL - foo(Some(42), 2, "");
@@ -91,7 +91,7 @@ note: function defined here
9191
--> $DIR/issue-34264.rs:3:4
9292
|
9393
LL | fn bar(x, y: usize) {}
94-
| ^^^ - --------
94+
| ^^^
9595
help: remove the extra argument
9696
|
9797
LL - bar(1, 2, 3);

‎tests/ui/span/missing-unit-argument.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ note: function defined here
3737
--> $DIR/missing-unit-argument.rs:1:4
3838
|
3939
LL | fn foo(():(), ():()) {}
40-
| ^^^ ----- -----
40+
| ^^^ -----
4141
help: provide the argument
4242
|
4343
LL | foo((), ());

‎tests/ui/traits/next-solver/diagnostics/coerce-in-may-coerce.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: function defined here
1010
--> $DIR/coerce-in-may-coerce.rs:12:4
1111
|
1212
LL | fn arg_error(x: <fn() as Mirror>::Assoc, y: ()) { todo!() }
13-
| ^^^^^^^^^ -------------------------- -----
13+
| ^^^^^^^^^
1414
help: swap these arguments
1515
|
1616
LL | arg_error(|| (), ());

‎tests/ui/type/type-check/point-at-inference-4.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ impl<A, B> S<A, B> {
44
fn infer(&self, a: A, b: B) {}
55
//~^ NOTE method defined here
66
//~| NOTE
7-
//~| NOTE
87
}
98

109
fn main() {

‎tests/ui/type/type-check/point-at-inference-4.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0061]: this method takes 2 arguments but 1 argument was supplied
2-
--> $DIR/point-at-inference-4.rs:12:7
2+
--> $DIR/point-at-inference-4.rs:11:7
33
|
44
LL | s.infer(0i32);
55
| ^^^^^------ argument #2 is missing
@@ -8,14 +8,14 @@ note: method defined here
88
--> $DIR/point-at-inference-4.rs:4:8
99
|
1010
LL | fn infer(&self, a: A, b: B) {}
11-
| ^^^^^ ---- ----
11+
| ^^^^^ ----
1212
help: provide the argument
1313
|
1414
LL | s.infer(0i32, /* b */);
1515
| ~~~~~~~~~~~~~~~
1616

1717
error[E0308]: mismatched types
18-
--> $DIR/point-at-inference-4.rs:19:24
18+
--> $DIR/point-at-inference-4.rs:18:24
1919
|
2020
LL | s.infer(0i32);
2121
| - ---- this argument has type `i32`...

‎tests/ui/typeck/remove-extra-argument.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ note: function defined here
88
--> $DIR/remove-extra-argument.rs:3:4
99
|
1010
LL | fn l(_a: Vec<u8>) {}
11-
| ^ -----------
11+
| ^
1212
help: remove the extra argument
1313
|
1414
LL - l(vec![], vec![])

0 commit comments

Comments
 (0)
Please sign in to comment.