Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions tests/ui/argument-suggestions/extra_arguments.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ edition:2015..2021
fn empty() {}
fn one_arg<T>(_a: T) {}
fn two_arg_same(_a: i32, _b: i32) {}
Expand Down
88 changes: 44 additions & 44 deletions tests/ui/argument-suggestions/extra_arguments.stderr
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0061]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/extra_arguments.rs:19:3
--> $DIR/extra_arguments.rs:20:3
|
LL | empty("");
| ^^^^^ -- unexpected argument of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
Expand All @@ -16,15 +16,15 @@ LL + empty();
|

error[E0061]: this function takes 0 arguments but 2 arguments were supplied
--> $DIR/extra_arguments.rs:20:3
--> $DIR/extra_arguments.rs:21:3
|
LL | empty(1, 1);
| ^^^^^ - - unexpected argument #2 of type `{integer}`
| |
| unexpected argument #1 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
Expand All @@ -35,13 +35,13 @@ LL + empty();
|

error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:22:3
--> $DIR/extra_arguments.rs:23:3
|
LL | one_arg(1, 1);
| ^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
Expand All @@ -52,13 +52,13 @@ LL + one_arg(1);
|

error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:23:3
--> $DIR/extra_arguments.rs:24:3
|
LL | one_arg(1, "");
| ^^^^^^^ -- unexpected argument #2 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
Expand All @@ -69,15 +69,15 @@ LL + one_arg(1);
|

error[E0061]: this function takes 1 argument but 3 arguments were supplied
--> $DIR/extra_arguments.rs:24:3
--> $DIR/extra_arguments.rs:25:3
|
LL | one_arg(1, "", 1.0);
| ^^^^^^^ -- --- unexpected argument #3 of type `{float}`
| |
| unexpected argument #2 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
Expand All @@ -88,13 +88,13 @@ LL + one_arg(1);
|

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:26:3
--> $DIR/extra_arguments.rs:27:3
|
LL | two_arg_same(1, 1, 1);
| ^^^^^^^^^^^^ - unexpected argument #3 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:3:4
--> $DIR/extra_arguments.rs:4:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
| ^^^^^^^^^^^^
Expand All @@ -105,13 +105,13 @@ LL + two_arg_same(1, 1);
|

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:27:3
--> $DIR/extra_arguments.rs:28:3
|
LL | two_arg_same(1, 1, 1.0);
| ^^^^^^^^^^^^ --- unexpected argument #3 of type `{float}`
|
note: function defined here
--> $DIR/extra_arguments.rs:3:4
--> $DIR/extra_arguments.rs:4:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
| ^^^^^^^^^^^^
Expand All @@ -122,13 +122,13 @@ LL + two_arg_same(1, 1);
|

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:29:3
--> $DIR/extra_arguments.rs:30:3
|
LL | two_arg_diff(1, 1, "");
| ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
Expand All @@ -139,13 +139,13 @@ LL + two_arg_diff(1, "");
|

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:30:3
--> $DIR/extra_arguments.rs:31:3
|
LL | two_arg_diff(1, "", "");
| ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
Expand All @@ -156,15 +156,15 @@ LL + two_arg_diff(1, "");
|

error[E0061]: this function takes 2 arguments but 4 arguments were supplied
--> $DIR/extra_arguments.rs:31:3
--> $DIR/extra_arguments.rs:32:3
|
LL | two_arg_diff(1, 1, "", "");
| ^^^^^^^^^^^^ - -- unexpected argument #4 of type `&'static str`
| |
| unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
Expand All @@ -175,15 +175,15 @@ LL + two_arg_diff(1, "");
|

error[E0061]: this function takes 2 arguments but 4 arguments were supplied
--> $DIR/extra_arguments.rs:32:3
--> $DIR/extra_arguments.rs:33:3
|
LL | two_arg_diff(1, "", 1, "");
| ^^^^^^^^^^^^ - -- unexpected argument #4 of type `&'static str`
| |
| unexpected argument #3 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
Expand All @@ -194,13 +194,13 @@ LL + two_arg_diff(1, "");
|

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:35:3
--> $DIR/extra_arguments.rs:36:3
|
LL | two_arg_same(1, 1, "");
| ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:3:4
--> $DIR/extra_arguments.rs:4:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
| ^^^^^^^^^^^^
Expand All @@ -211,13 +211,13 @@ LL + two_arg_same(1, 1);
|

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:36:3
--> $DIR/extra_arguments.rs:37:3
|
LL | two_arg_diff(1, 1, "");
| ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
Expand All @@ -228,7 +228,7 @@ LL + two_arg_diff(1, "");
|

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:37:3
--> $DIR/extra_arguments.rs:38:3
|
LL | two_arg_same(
| ^^^^^^^^^^^^
Expand All @@ -237,7 +237,7 @@ LL | ""
| -- unexpected argument #3 of type `&'static str`
|
note: function defined here
--> $DIR/extra_arguments.rs:3:4
--> $DIR/extra_arguments.rs:4:4
|
LL | fn two_arg_same(_a: i32, _b: i32) {}
| ^^^^^^^^^^^^
Expand All @@ -249,7 +249,7 @@ LL + 1
|

error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/extra_arguments.rs:43:3
--> $DIR/extra_arguments.rs:44:3
|
LL | two_arg_diff(
| ^^^^^^^^^^^^
Expand All @@ -258,7 +258,7 @@ LL | 1,
| - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:4:4
--> $DIR/extra_arguments.rs:5:4
|
LL | fn two_arg_diff(_a: i32, _b: &str) {}
| ^^^^^^^^^^^^
Expand All @@ -268,7 +268,7 @@ LL - 1,
|

error[E0061]: this function takes 0 arguments but 2 arguments were supplied
--> $DIR/extra_arguments.rs:8:9
--> $DIR/extra_arguments.rs:9:9
|
LL | empty($x, 1);
| ^^^^^ - unexpected argument #2 of type `{integer}`
Expand All @@ -280,14 +280,14 @@ LL | foo!(1, ~);
| in this macro invocation
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0061]: this function takes 0 arguments but 2 arguments were supplied
--> $DIR/extra_arguments.rs:14:9
--> $DIR/extra_arguments.rs:15:9
|
LL | empty(1, $y);
| ^^^^^ - unexpected argument #1 of type `{integer}`
Expand All @@ -299,14 +299,14 @@ LL | foo!(~, 1);
| in this macro invocation
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0061]: this function takes 0 arguments but 2 arguments were supplied
--> $DIR/extra_arguments.rs:11:9
--> $DIR/extra_arguments.rs:12:9
|
LL | empty($x, $y);
| ^^^^^
Expand All @@ -319,20 +319,20 @@ LL | foo!(1, 1);
| in this macro invocation
|
note: function defined here
--> $DIR/extra_arguments.rs:1:4
--> $DIR/extra_arguments.rs:2:4
|
LL | fn empty() {}
| ^^^^^
= note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:53:3
--> $DIR/extra_arguments.rs:54:3
|
LL | one_arg(1, panic!());
| ^^^^^^^ -------- unexpected argument #2
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
Expand All @@ -343,13 +343,13 @@ LL + one_arg(1);
|

error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:54:3
--> $DIR/extra_arguments.rs:55:3
|
LL | one_arg(panic!(), 1);
| ^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
Expand All @@ -360,13 +360,13 @@ LL + one_arg(panic!());
|

error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:55:3
--> $DIR/extra_arguments.rs:56:3
|
LL | one_arg(stringify!($e), 1);
| ^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
Expand All @@ -377,13 +377,13 @@ LL + one_arg(stringify!($e));
|

error[E0061]: this function takes 1 argument but 2 arguments were supplied
--> $DIR/extra_arguments.rs:60:3
--> $DIR/extra_arguments.rs:61:3
|
LL | one_arg(for _ in 1.. {}, 1);
| ^^^^^^^ - unexpected argument #2 of type `{integer}`
|
note: function defined here
--> $DIR/extra_arguments.rs:2:4
--> $DIR/extra_arguments.rs:3:4
|
LL | fn one_arg<T>(_a: T) {}
| ^^^^^^^
Expand Down
1 change: 1 addition & 0 deletions tests/ui/asm/naked-invalid-attr.rs
Copy link
Member

@fmease fmease Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll use this concrete test as an example but this is more of a general question / issue (to be honest, I haven't looked at any of the other test changes so far):

With only minor "meta" modifications (i.e., adjusting compiletest directives & annotations only), this test can easily run in Rust 2018, 2021 and 2024, too. So I'm wondering about the greater vision and how we should go about it procedurally:

Did you plan on going over all tests again and submitting ~medium-sized follow-up PRs that relax the edition ranges of tests (and require a bit more manual work, namely those "meta" changes)? I mean I would assume so (I can also imagine the possibility that you consider this "done" for now, hence me asking). Alternatively, we could do this now in this PR.

^ This might be of interest for the next T-compiler meeting.

Copy link
Member

@fmease fmease Oct 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E.g., this test can be tweaked to work in Rust 2018 and Rust 2021 via trivial revisions:

//@ revisions: e2015 e2018
//@[e2015] edition: 2015
//@[e2018] edition: 2018

plus

//[e2015]~| ERROR failed to resolve: use of unresolved module or unlinked crate `a`
//[e2018]~| ERROR failed to resolve: could not find `a` in the list of imported crates

OR

//~| ERROR failed to resolve

As for Rust 2024, we probably want to migrate the implicitly unsafe extern {} to unsafe extern {} to keep this test focused (as we probably don't want to "retest" the "extern block without unsafe" error case) but you probably know that already.

That's just for illustration, I get that you plan on doing the Rust 2024 "receptivity" in a follow-up.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey yes, you're right. The idea is that once the whole test suite passes with any edition, I can start submitting patches with smaller changes, more tailored to covering each test with an appropriate range of editions.

Submitting those patches before this PR would be very annoying to review and run locally as you'd have to run only the tests that were changed.

This comment was marked as duplicate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we should keep these PRs narrowly focused, mechanical is best. Mixing different kind of changes make it super easy for unexpected changes to be accidentally done among other diffs.

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//@ edition:2015
// Checks that the #[unsafe(naked)] attribute can be placed on function definitions only.
//
//@ needs-asm-support
Expand Down
Loading
Loading