Skip to content

Commit 5d63e10

Browse files
committed
rebase and review comments
1 parent 287cd59 commit 5d63e10

24 files changed

+56
-57
lines changed

compiler/rustc_errors/src/diagnostic.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ impl Diagnostic {
612612
pub fn multipart_suggestion_with_style(
613613
&mut self,
614614
msg: impl Into<SubdiagnosticMessage>,
615-
mut suggestion: Vec<(Span, String)>,
615+
suggestion: Vec<(Span, String)>,
616616
applicability: Applicability,
617617
style: SuggestionStyle,
618618
) -> &mut Self {
@@ -634,7 +634,6 @@ impl Diagnostic {
634634
None,
635635
"suggestion must not have overlapping parts",
636636
);
637-
suggestion.sort_by_key(|(span, _)| (span.lo(), span.hi()));
638637

639638
self.push_suggestion(CodeSuggestion {
640639
substitutions: vec![Substitution { parts }],

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
930930
"".to_string()
931931
};
932932
labels
933-
.push((provided_span, format!("argument{} unexpected", provided_ty_name)));
933+
.push((provided_span, format!("unexpected argument{}", provided_ty_name)));
934934
let mut span = provided_span;
935935
if arg_idx.index() > 0
936936
&& let Some((_, prev)) = provided_arg_tys

tests/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | fn oom() -> ! {
77
| _-^^^^^^^^^^^^
88
LL | | loop {}
99
LL | | }
10-
| |_- argument of type `core::alloc::Layout` unexpected
10+
| |_- unexpected argument of type `core::alloc::Layout`
1111
|
1212
note: function defined here
1313
--> $DIR/alloc-error-handler-bad-signature-3.rs:10:4

tests/ui/argument-suggestions/basic.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
1616
--> $DIR/basic.rs:21:5
1717
|
1818
LL | extra("");
19-
| ^^^^^ -- argument of type `&'static str` unexpected
19+
| ^^^^^ -- unexpected argument of type `&'static str`
2020
|
2121
note: function defined here
2222
--> $DIR/basic.rs:14:4

tests/ui/argument-suggestions/exotic-calls.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
22
--> $DIR/exotic-calls.rs:2:5
33
|
44
LL | t(1i32);
5-
| ^ ---- argument of type `i32` unexpected
5+
| ^ ---- unexpected argument of type `i32`
66
|
77
note: callable defined here
88
--> $DIR/exotic-calls.rs:1:11
@@ -19,7 +19,7 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
1919
--> $DIR/exotic-calls.rs:7:5
2020
|
2121
LL | t(1i32);
22-
| ^ ---- argument of type `i32` unexpected
22+
| ^ ---- unexpected argument of type `i32`
2323
|
2424
note: type parameter defined here
2525
--> $DIR/exotic-calls.rs:6:11
@@ -36,7 +36,7 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
3636
--> $DIR/exotic-calls.rs:16:5
3737
|
3838
LL | baz()(1i32)
39-
| ^^^^^ ---- argument of type `i32` unexpected
39+
| ^^^^^ ---- unexpected argument of type `i32`
4040
|
4141
note: opaque type defined here
4242
--> $DIR/exotic-calls.rs:11:13
@@ -53,7 +53,7 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
5353
--> $DIR/exotic-calls.rs:22:5
5454
|
5555
LL | x(1i32);
56-
| ^ ---- argument of type `i32` unexpected
56+
| ^ ---- unexpected argument of type `i32`
5757
|
5858
note: closure defined here
5959
--> $DIR/exotic-calls.rs:21:13

tests/ui/argument-suggestions/extra_arguments.stderr

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
22
--> $DIR/extra_arguments.rs:7:3
33
|
44
LL | empty("");
5-
| ^^^^^ -- argument of type `&'static str` unexpected
5+
| ^^^^^ -- unexpected argument of type `&'static str`
66
|
77
note: function defined here
88
--> $DIR/extra_arguments.rs:1:4
@@ -19,7 +19,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
1919
--> $DIR/extra_arguments.rs:9:3
2020
|
2121
LL | one_arg(1, 1);
22-
| ^^^^^^^ - argument of type `{integer}` unexpected
22+
| ^^^^^^^ - unexpected argument of type `{integer}`
2323
|
2424
note: function defined here
2525
--> $DIR/extra_arguments.rs:2:4
@@ -36,7 +36,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
3636
--> $DIR/extra_arguments.rs:10:3
3737
|
3838
LL | one_arg(1, "");
39-
| ^^^^^^^ -- argument of type `&'static str` unexpected
39+
| ^^^^^^^ -- unexpected argument of type `&'static str`
4040
|
4141
note: function defined here
4242
--> $DIR/extra_arguments.rs:2:4
@@ -53,9 +53,9 @@ error[E0061]: this function takes 1 argument but 3 arguments were supplied
5353
--> $DIR/extra_arguments.rs:11:3
5454
|
5555
LL | one_arg(1, "", 1.0);
56-
| ^^^^^^^ -- --- argument of type `{float}` unexpected
56+
| ^^^^^^^ -- --- unexpected argument of type `{float}`
5757
| |
58-
| argument of type `&'static str` unexpected
58+
| unexpected argument of type `&'static str`
5959
|
6060
note: function defined here
6161
--> $DIR/extra_arguments.rs:2:4
@@ -72,7 +72,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
7272
--> $DIR/extra_arguments.rs:13:3
7373
|
7474
LL | two_arg_same(1, 1, 1);
75-
| ^^^^^^^^^^^^ - argument of type `{integer}` unexpected
75+
| ^^^^^^^^^^^^ - unexpected argument of type `{integer}`
7676
|
7777
note: function defined here
7878
--> $DIR/extra_arguments.rs:3:4
@@ -89,7 +89,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
8989
--> $DIR/extra_arguments.rs:14:3
9090
|
9191
LL | two_arg_same(1, 1, 1.0);
92-
| ^^^^^^^^^^^^ --- argument of type `{float}` unexpected
92+
| ^^^^^^^^^^^^ --- unexpected argument of type `{float}`
9393
|
9494
note: function defined here
9595
--> $DIR/extra_arguments.rs:3:4
@@ -106,7 +106,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
106106
--> $DIR/extra_arguments.rs:16:3
107107
|
108108
LL | two_arg_diff(1, 1, "");
109-
| ^^^^^^^^^^^^ - argument of type `{integer}` unexpected
109+
| ^^^^^^^^^^^^ - unexpected argument of type `{integer}`
110110
|
111111
note: function defined here
112112
--> $DIR/extra_arguments.rs:4:4
@@ -123,7 +123,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
123123
--> $DIR/extra_arguments.rs:17:3
124124
|
125125
LL | two_arg_diff(1, "", "");
126-
| ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected
126+
| ^^^^^^^^^^^^ -- unexpected argument of type `&'static str`
127127
|
128128
note: function defined here
129129
--> $DIR/extra_arguments.rs:4:4
@@ -140,9 +140,9 @@ error[E0061]: this function takes 2 arguments but 4 arguments were supplied
140140
--> $DIR/extra_arguments.rs:18:3
141141
|
142142
LL | two_arg_diff(1, 1, "", "");
143-
| ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected
143+
| ^^^^^^^^^^^^ - -- unexpected argument of type `&'static str`
144144
| |
145-
| argument of type `{integer}` unexpected
145+
| unexpected argument of type `{integer}`
146146
|
147147
note: function defined here
148148
--> $DIR/extra_arguments.rs:4:4
@@ -159,9 +159,9 @@ error[E0061]: this function takes 2 arguments but 4 arguments were supplied
159159
--> $DIR/extra_arguments.rs:19:3
160160
|
161161
LL | two_arg_diff(1, "", 1, "");
162-
| ^^^^^^^^^^^^ - -- argument of type `&'static str` unexpected
162+
| ^^^^^^^^^^^^ - -- unexpected argument of type `&'static str`
163163
| |
164-
| argument of type `{integer}` unexpected
164+
| unexpected argument of type `{integer}`
165165
|
166166
note: function defined here
167167
--> $DIR/extra_arguments.rs:4:4
@@ -178,7 +178,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
178178
--> $DIR/extra_arguments.rs:22:3
179179
|
180180
LL | two_arg_same(1, 1, "");
181-
| ^^^^^^^^^^^^ -- argument of type `&'static str` unexpected
181+
| ^^^^^^^^^^^^ -- unexpected argument of type `&'static str`
182182
|
183183
note: function defined here
184184
--> $DIR/extra_arguments.rs:3:4
@@ -195,7 +195,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
195195
--> $DIR/extra_arguments.rs:23:3
196196
|
197197
LL | two_arg_diff(1, 1, "");
198-
| ^^^^^^^^^^^^ - argument of type `{integer}` unexpected
198+
| ^^^^^^^^^^^^ - unexpected argument of type `{integer}`
199199
|
200200
note: function defined here
201201
--> $DIR/extra_arguments.rs:4:4
@@ -215,7 +215,7 @@ LL | two_arg_same(
215215
| ^^^^^^^^^^^^
216216
...
217217
LL | ""
218-
| -- argument of type `&'static str` unexpected
218+
| -- unexpected argument of type `&'static str`
219219
|
220220
note: function defined here
221221
--> $DIR/extra_arguments.rs:3:4
@@ -235,7 +235,7 @@ LL | two_arg_diff(
235235
| ^^^^^^^^^^^^
236236
LL | 1,
237237
LL | 1,
238-
| - argument of type `{integer}` unexpected
238+
| - unexpected argument of type `{integer}`
239239
|
240240
note: function defined here
241241
--> $DIR/extra_arguments.rs:4:4

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0061]: this function takes 6 arguments but 7 arguments were supplied
44
LL | f(C, A, A, A, B, B, C);
55
| ^ - - - - expected `C`, found `B`
66
| | | |
7-
| | | argument of type `A` unexpected
7+
| | | unexpected argument of type `A`
88
| | expected `B`, found `A`
99
| expected `A`, found `C`
1010
|
@@ -64,8 +64,8 @@ error[E0308]: arguments to this function are incorrect
6464
LL | f(A, A, D, D, B, B);
6565
| ^ - - ---- two arguments of type `C` and `C` are missing
6666
| | |
67-
| | argument of type `D` unexpected
68-
| argument of type `D` unexpected
67+
| | unexpected argument of type `D`
68+
| unexpected argument of type `D`
6969
|
7070
note: function defined here
7171
--> $DIR/issue-101097.rs:6:4

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ error[E0061]: this function takes 4 arguments but 7 arguments were supplied
22
--> $DIR/issue-97484.rs:12:5
33
|
44
LL | foo(&&A, B, C, D, E, F, G);
5-
| ^^^ - - - - argument of type `F` unexpected
5+
| ^^^ - - - - unexpected argument of type `F`
66
| | | |
77
| | | expected `&E`, found `E`
8-
| | argument of type `C` unexpected
9-
| argument of type `B` unexpected
8+
| | unexpected argument of type `C`
9+
| unexpected argument of type `B`
1010
|
1111
note: function defined here
1212
--> $DIR/issue-97484.rs:9:4

tests/ui/argument-suggestions/mixed_cases.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
22
--> $DIR/mixed_cases.rs:10:3
33
|
44
LL | two_args(1, "", X {});
5-
| ^^^^^^^^ -- ---- argument of type `X` unexpected
5+
| ^^^^^^^^ -- ---- unexpected argument of type `X`
66
| |
77
| expected `f32`, found `&str`
88
|
@@ -21,9 +21,9 @@ error[E0061]: this function takes 3 arguments but 4 arguments were supplied
2121
--> $DIR/mixed_cases.rs:11:3
2222
|
2323
LL | three_args(1, "", X {}, "");
24-
| ^^^^^^^^^^ -- ---- -- argument of type `&'static str` unexpected
24+
| ^^^^^^^^^^ -- ---- -- unexpected argument of type `&'static str`
2525
| | |
26-
| | argument of type `X` unexpected
26+
| | unexpected argument of type `X`
2727
| an argument of type `f32` is missing
2828
|
2929
note: function defined here
@@ -59,7 +59,7 @@ error[E0308]: arguments to this function are incorrect
5959
--> $DIR/mixed_cases.rs:17:3
6060
|
6161
LL | three_args(1, "", X {});
62-
| ^^^^^^^^^^ -- ---- argument of type `X` unexpected
62+
| ^^^^^^^^^^ -- ---- unexpected argument of type `X`
6363
| |
6464
| an argument of type `f32` is missing
6565
|

tests/ui/error-codes/E0057.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ error[E0057]: this function takes 1 argument but 2 arguments were supplied
1818
--> $DIR/E0057.rs:5:13
1919
|
2020
LL | let c = f(2, 3);
21-
| ^ - argument of type `{integer}` unexpected
21+
| ^ - unexpected argument of type `{integer}`
2222
|
2323
note: closure defined here
2424
--> $DIR/E0057.rs:2:13

tests/ui/issues/issue-16939.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
22
--> $DIR/issue-16939.rs:5:9
33
|
44
LL | |t| f(t);
5-
| ^ - argument unexpected
5+
| ^ - unexpected argument
66
|
77
note: callable defined here
88
--> $DIR/issue-16939.rs:4:12

tests/ui/issues/issue-26094.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
macro_rules! some_macro {
22
($other: expr) => ({
3-
$other(None) //~ NOTE argument of type `Option<_>` unexpected
3+
$other(None) //~ NOTE unexpected argument of type `Option<_>`
44
})
55
}
66

tests/ui/issues/issue-26094.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
22
--> $DIR/issue-26094.rs:10:17
33
|
44
LL | $other(None)
5-
| ---- argument of type `Option<_>` unexpected
5+
| ---- unexpected argument of type `Option<_>`
66
...
77
LL | some_macro!(some_function);
88
| ^^^^^^^^^^^^^

tests/ui/issues/issue-4935.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
22
--> $DIR/issue-4935.rs:5:13
33
|
44
LL | fn main() { foo(5, 6) }
5-
| ^^^ - argument of type `{integer}` unexpected
5+
| ^^^ - unexpected argument of type `{integer}`
66
|
77
note: function defined here
88
--> $DIR/issue-4935.rs:3:4

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0061]: this method takes 0 arguments but 1 argument was supplied
22
--> $DIR/method-call-err-msg.rs:13:7
33
|
44
LL | x.zero(0)
5-
| ^^^^ - argument of type `{integer}` unexpected
5+
| ^^^^ - unexpected argument of type `{integer}`
66
|
77
note: associated function defined here
88
--> $DIR/method-call-err-msg.rs:5:8

tests/ui/mismatched_types/overloaded-calls-bad.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ error[E0057]: this function takes 1 argument but 2 arguments were supplied
3232
--> $DIR/overloaded-calls-bad.rs:37:15
3333
|
3434
LL | let ans = s("burma", "shave");
35-
| ^ ------- ------- argument of type `&'static str` unexpected
35+
| ^ ------- ------- unexpected argument of type `&'static str`
3636
| |
3737
| expected `isize`, found `&str`
3838
|

tests/ui/resolve/resolve-primitive-fallback.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
2424
--> $DIR/resolve-primitive-fallback.rs:3:5
2525
|
2626
LL | std::mem::size_of(u16);
27-
| ^^^^^^^^^^^^^^^^^ --- argument unexpected
27+
| ^^^^^^^^^^^^^^^^^ --- unexpected argument
2828
|
2929
note: function defined here
3030
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL

tests/ui/span/issue-34264.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
5454
--> $DIR/issue-34264.rs:7:5
5555
|
5656
LL | foo(Some(42), 2, "");
57-
| ^^^ -- argument of type `&'static str` unexpected
57+
| ^^^ -- unexpected argument of type `&'static str`
5858
|
5959
note: function defined here
6060
--> $DIR/issue-34264.rs:1:4
@@ -85,7 +85,7 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
8585
--> $DIR/issue-34264.rs:10:5
8686
|
8787
LL | bar(1, 2, 3);
88-
| ^^^ - argument of type `{integer}` unexpected
88+
| ^^^ - unexpected argument of type `{integer}`
8989
|
9090
note: function defined here
9191
--> $DIR/issue-34264.rs:3:4

tests/ui/suggestions/args-instead-of-tuple-errors.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
22
--> $DIR/args-instead-of-tuple-errors.rs:6:34
33
|
44
LL | let _: Option<(i32, bool)> = Some(1, 2);
5-
| ^^^^ - argument of type `{integer}` unexpected
5+
| ^^^^ - unexpected argument of type `{integer}`
66
|
77
note: expected `(i32, bool)`, found integer
88
--> $DIR/args-instead-of-tuple-errors.rs:6:39
@@ -30,7 +30,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
3030
--> $DIR/args-instead-of-tuple-errors.rs:8:5
3131
|
3232
LL | int_bool(1, 2);
33-
| ^^^^^^^^ - argument of type `{integer}` unexpected
33+
| ^^^^^^^^ - unexpected argument of type `{integer}`
3434
|
3535
note: expected `(i32, bool)`, found integer
3636
--> $DIR/args-instead-of-tuple-errors.rs:8:14

tests/ui/tuple/wrong_argument_ice-3.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0061]: this method takes 1 argument but 2 arguments were supplied
22
--> $DIR/wrong_argument_ice-3.rs:9:16
33
|
44
LL | groups.push(new_group, vec![process]);
5-
| ^^^^ ------------- argument of type `Vec<&Process>` unexpected
5+
| ^^^^ ------------- unexpected argument of type `Vec<&Process>`
66
|
77
note: expected `(Vec<String>, Vec<Process>)`, found `Vec<String>`
88
--> $DIR/wrong_argument_ice-3.rs:9:21

0 commit comments

Comments
 (0)