diff --git a/tests/ui/argument-suggestions/extra_arguments.stderr b/tests/ui/argument-suggestions/extra_arguments.edition2015.stderr similarity index 88% rename from tests/ui/argument-suggestions/extra_arguments.stderr rename to tests/ui/argument-suggestions/extra_arguments.edition2015.stderr index 0c80ae8acc433..a79c40d17ee98 100644 --- a/tests/ui/argument-suggestions/extra_arguments.stderr +++ b/tests/ui/argument-suggestions/extra_arguments.edition2015.stderr @@ -1,11 +1,11 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/extra_arguments.rs:20:3 + --> $DIR/extra_arguments.rs:24:3 | LL | empty(""); | ^^^^^ -- unexpected argument of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:6:4 | LL | fn empty() {} | ^^^^^ @@ -16,7 +16,7 @@ LL + empty(); | error[E0061]: this function takes 0 arguments but 2 arguments were supplied - --> $DIR/extra_arguments.rs:21:3 + --> $DIR/extra_arguments.rs:25:3 | LL | empty(1, 1); | ^^^^^ - - unexpected argument #2 of type `{integer}` @@ -24,7 +24,7 @@ LL | empty(1, 1); | unexpected argument #1 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:6:4 | LL | fn empty() {} | ^^^^^ @@ -35,13 +35,13 @@ LL + empty(); | error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:23:3 + --> $DIR/extra_arguments.rs:27:3 | LL | one_arg(1, 1); | ^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:7:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -52,13 +52,13 @@ LL + one_arg(1); | error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:24:3 + --> $DIR/extra_arguments.rs:28:3 | LL | one_arg(1, ""); | ^^^^^^^ -- unexpected argument #2 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:7:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -69,7 +69,7 @@ LL + one_arg(1); | error[E0061]: this function takes 1 argument but 3 arguments were supplied - --> $DIR/extra_arguments.rs:25:3 + --> $DIR/extra_arguments.rs:29:3 | LL | one_arg(1, "", 1.0); | ^^^^^^^ -- --- unexpected argument #3 of type `{float}` @@ -77,7 +77,7 @@ LL | one_arg(1, "", 1.0); | unexpected argument #2 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:7:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -88,13 +88,13 @@ LL + one_arg(1); | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:27:3 + --> $DIR/extra_arguments.rs:31:3 | LL | two_arg_same(1, 1, 1); | ^^^^^^^^^^^^ - unexpected argument #3 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:8:4 | LL | fn two_arg_same(_a: i32, _b: i32) {} | ^^^^^^^^^^^^ @@ -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:28:3 + --> $DIR/extra_arguments.rs:32:3 | LL | two_arg_same(1, 1, 1.0); | ^^^^^^^^^^^^ --- unexpected argument #3 of type `{float}` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:8:4 | LL | fn two_arg_same(_a: i32, _b: i32) {} | ^^^^^^^^^^^^ @@ -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:30:3 + --> $DIR/extra_arguments.rs:34:3 | LL | two_arg_diff(1, 1, ""); | ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:5:4 + --> $DIR/extra_arguments.rs:9:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -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:31:3 + --> $DIR/extra_arguments.rs:35:3 | LL | two_arg_diff(1, "", ""); | ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:5:4 + --> $DIR/extra_arguments.rs:9:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -156,7 +156,7 @@ 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:36:3 | LL | two_arg_diff(1, 1, "", ""); | ^^^^^^^^^^^^ - -- unexpected argument #4 of type `&'static str` @@ -164,7 +164,7 @@ LL | two_arg_diff(1, 1, "", ""); | unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:5:4 + --> $DIR/extra_arguments.rs:9:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -175,7 +175,7 @@ LL + two_arg_diff(1, ""); | error[E0061]: this function takes 2 arguments but 4 arguments were supplied - --> $DIR/extra_arguments.rs:33:3 + --> $DIR/extra_arguments.rs:37:3 | LL | two_arg_diff(1, "", 1, ""); | ^^^^^^^^^^^^ - -- unexpected argument #4 of type `&'static str` @@ -183,7 +183,7 @@ LL | two_arg_diff(1, "", 1, ""); | unexpected argument #3 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:5:4 + --> $DIR/extra_arguments.rs:9:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -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:36:3 + --> $DIR/extra_arguments.rs:40:3 | LL | two_arg_same(1, 1, ""); | ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:8:4 | LL | fn two_arg_same(_a: i32, _b: i32) {} | ^^^^^^^^^^^^ @@ -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:37:3 + --> $DIR/extra_arguments.rs:41:3 | LL | two_arg_diff(1, 1, ""); | ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:5:4 + --> $DIR/extra_arguments.rs:9:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -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:38:3 + --> $DIR/extra_arguments.rs:42:3 | LL | two_arg_same( | ^^^^^^^^^^^^ @@ -237,7 +237,7 @@ LL | "" | -- unexpected argument #3 of type `&'static str` | note: function defined here - --> $DIR/extra_arguments.rs:4:4 + --> $DIR/extra_arguments.rs:8:4 | LL | fn two_arg_same(_a: i32, _b: i32) {} | ^^^^^^^^^^^^ @@ -249,7 +249,7 @@ LL + 1 | error[E0061]: this function takes 2 arguments but 3 arguments were supplied - --> $DIR/extra_arguments.rs:44:3 + --> $DIR/extra_arguments.rs:48:3 | LL | two_arg_diff( | ^^^^^^^^^^^^ @@ -258,7 +258,7 @@ LL | 1, | - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:5:4 + --> $DIR/extra_arguments.rs:9:4 | LL | fn two_arg_diff(_a: i32, _b: &str) {} | ^^^^^^^^^^^^ @@ -268,7 +268,7 @@ LL - 1, | error[E0061]: this function takes 0 arguments but 2 arguments were supplied - --> $DIR/extra_arguments.rs:9:9 + --> $DIR/extra_arguments.rs:13:9 | LL | empty($x, 1); | ^^^^^ - unexpected argument #2 of type `{integer}` @@ -280,14 +280,14 @@ LL | foo!(1, ~); | in this macro invocation | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:6: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:15:9 + --> $DIR/extra_arguments.rs:19:9 | LL | empty(1, $y); | ^^^^^ - unexpected argument #1 of type `{integer}` @@ -299,14 +299,14 @@ LL | foo!(~, 1); | in this macro invocation | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:6: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:12:9 + --> $DIR/extra_arguments.rs:16:9 | LL | empty($x, $y); | ^^^^^ @@ -319,20 +319,20 @@ LL | foo!(1, 1); | in this macro invocation | note: function defined here - --> $DIR/extra_arguments.rs:2:4 + --> $DIR/extra_arguments.rs:6: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:54:3 + --> $DIR/extra_arguments.rs:58:3 | LL | one_arg(1, panic!()); | ^^^^^^^ -------- unexpected argument #2 | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:7:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -343,13 +343,13 @@ LL + one_arg(1); | error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:55:3 + --> $DIR/extra_arguments.rs:59:3 | LL | one_arg(panic!(), 1); | ^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:7:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -360,13 +360,13 @@ LL + one_arg(panic!()); | error[E0061]: this function takes 1 argument but 2 arguments were supplied - --> $DIR/extra_arguments.rs:56:3 + --> $DIR/extra_arguments.rs:60:3 | LL | one_arg(stringify!($e), 1); | ^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:7:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ @@ -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:61:3 + --> $DIR/extra_arguments.rs:65:3 | LL | one_arg(for _ in 1.. {}, 1); | ^^^^^^^ - unexpected argument #2 of type `{integer}` | note: function defined here - --> $DIR/extra_arguments.rs:3:4 + --> $DIR/extra_arguments.rs:7:4 | LL | fn one_arg(_a: T) {} | ^^^^^^^ diff --git a/tests/ui/argument-suggestions/extra_arguments.edition2018.stderr b/tests/ui/argument-suggestions/extra_arguments.edition2018.stderr new file mode 100644 index 0000000000000..a79c40d17ee98 --- /dev/null +++ b/tests/ui/argument-suggestions/extra_arguments.edition2018.stderr @@ -0,0 +1,398 @@ +error[E0061]: this function takes 0 arguments but 1 argument was supplied + --> $DIR/extra_arguments.rs:24:3 + | +LL | empty(""); + | ^^^^^ -- unexpected argument of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:6:4 + | +LL | fn empty() {} + | ^^^^^ +help: remove the extra argument + | +LL - empty(""); +LL + empty(); + | + +error[E0061]: this function takes 0 arguments but 2 arguments were supplied + --> $DIR/extra_arguments.rs:25: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:6:4 + | +LL | fn empty() {} + | ^^^^^ +help: remove the extra arguments + | +LL - empty(1, 1); +LL + empty(); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:27:3 + | +LL | one_arg(1, 1); + | ^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(1, 1); +LL + one_arg(1); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:28:3 + | +LL | one_arg(1, ""); + | ^^^^^^^ -- unexpected argument #2 of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(1, ""); +LL + one_arg(1); + | + +error[E0061]: this function takes 1 argument but 3 arguments were supplied + --> $DIR/extra_arguments.rs:29: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:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra arguments + | +LL - one_arg(1, "", 1.0); +LL + one_arg(1); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:31:3 + | +LL | two_arg_same(1, 1, 1); + | ^^^^^^^^^^^^ - unexpected argument #3 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:8:4 + | +LL | fn two_arg_same(_a: i32, _b: i32) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_same(1, 1, 1); +LL + two_arg_same(1, 1); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:32:3 + | +LL | two_arg_same(1, 1, 1.0); + | ^^^^^^^^^^^^ --- unexpected argument #3 of type `{float}` + | +note: function defined here + --> $DIR/extra_arguments.rs:8:4 + | +LL | fn two_arg_same(_a: i32, _b: i32) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_same(1, 1, 1.0); +LL + two_arg_same(1, 1); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:34:3 + | +LL | two_arg_diff(1, 1, ""); + | ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_diff(1, 1, ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:35:3 + | +LL | two_arg_diff(1, "", ""); + | ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_diff(1, "", ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 4 arguments were supplied + --> $DIR/extra_arguments.rs:36: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:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra arguments + | +LL - two_arg_diff(1, 1, "", ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 4 arguments were supplied + --> $DIR/extra_arguments.rs:37: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:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra arguments + | +LL - two_arg_diff(1, "", 1, ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:40:3 + | +LL | two_arg_same(1, 1, ""); + | ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:8:4 + | +LL | fn two_arg_same(_a: i32, _b: i32) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_same(1, 1, ""); +LL + two_arg_same(1, 1); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:41:3 + | +LL | two_arg_diff(1, 1, ""); + | ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_diff(1, 1, ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:42:3 + | +LL | two_arg_same( + | ^^^^^^^^^^^^ +... +LL | "" + | -- unexpected argument #3 of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:8:4 + | +LL | fn two_arg_same(_a: i32, _b: i32) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - 1, +LL - "" +LL + 1 + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:48:3 + | +LL | two_arg_diff( + | ^^^^^^^^^^^^ +LL | 1, +LL | 1, + | - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - 1, + | + +error[E0061]: this function takes 0 arguments but 2 arguments were supplied + --> $DIR/extra_arguments.rs:13:9 + | +LL | empty($x, 1); + | ^^^^^ - unexpected argument #2 of type `{integer}` +... +LL | foo!(1, ~); + | ---------- + | | | + | | unexpected argument #1 of type `{integer}` + | in this macro invocation + | +note: function defined here + --> $DIR/extra_arguments.rs:6: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:19:9 + | +LL | empty(1, $y); + | ^^^^^ - unexpected argument #1 of type `{integer}` +... +LL | foo!(~, 1); + | ---------- + | | | + | | unexpected argument #2 of type `{integer}` + | in this macro invocation + | +note: function defined here + --> $DIR/extra_arguments.rs:6: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:16:9 + | +LL | empty($x, $y); + | ^^^^^ +... +LL | foo!(1, 1); + | ---------- + | | | | + | | | unexpected argument #2 of type `{integer}` + | | unexpected argument #1 of type `{integer}` + | in this macro invocation + | +note: function defined here + --> $DIR/extra_arguments.rs:6: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:58:3 + | +LL | one_arg(1, panic!()); + | ^^^^^^^ -------- unexpected argument #2 + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(1, panic!()); +LL + one_arg(1); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:59:3 + | +LL | one_arg(panic!(), 1); + | ^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(panic!(), 1); +LL + one_arg(panic!()); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:60:3 + | +LL | one_arg(stringify!($e), 1); + | ^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(stringify!($e), 1); +LL + one_arg(stringify!($e)); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:65:3 + | +LL | one_arg(for _ in 1.. {}, 1); + | ^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(for _ in 1.. {}, 1); +LL + one_arg(for _ in 1.. {}); + | + +error: aborting due to 22 previous errors + +For more information about this error, try `rustc --explain E0061`. diff --git a/tests/ui/argument-suggestions/extra_arguments.edition2021.stderr b/tests/ui/argument-suggestions/extra_arguments.edition2021.stderr new file mode 100644 index 0000000000000..6715bc3adbc4c --- /dev/null +++ b/tests/ui/argument-suggestions/extra_arguments.edition2021.stderr @@ -0,0 +1,398 @@ +error[E0061]: this function takes 0 arguments but 1 argument was supplied + --> $DIR/extra_arguments.rs:24:3 + | +LL | empty(""); + | ^^^^^ -- unexpected argument of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:6:4 + | +LL | fn empty() {} + | ^^^^^ +help: remove the extra argument + | +LL - empty(""); +LL + empty(); + | + +error[E0061]: this function takes 0 arguments but 2 arguments were supplied + --> $DIR/extra_arguments.rs:25: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:6:4 + | +LL | fn empty() {} + | ^^^^^ +help: remove the extra arguments + | +LL - empty(1, 1); +LL + empty(); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:27:3 + | +LL | one_arg(1, 1); + | ^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(1, 1); +LL + one_arg(1); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:28:3 + | +LL | one_arg(1, ""); + | ^^^^^^^ -- unexpected argument #2 of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(1, ""); +LL + one_arg(1); + | + +error[E0061]: this function takes 1 argument but 3 arguments were supplied + --> $DIR/extra_arguments.rs:29: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:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra arguments + | +LL - one_arg(1, "", 1.0); +LL + one_arg(1); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:31:3 + | +LL | two_arg_same(1, 1, 1); + | ^^^^^^^^^^^^ - unexpected argument #3 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:8:4 + | +LL | fn two_arg_same(_a: i32, _b: i32) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_same(1, 1, 1); +LL + two_arg_same(1, 1); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:32:3 + | +LL | two_arg_same(1, 1, 1.0); + | ^^^^^^^^^^^^ --- unexpected argument #3 of type `{float}` + | +note: function defined here + --> $DIR/extra_arguments.rs:8:4 + | +LL | fn two_arg_same(_a: i32, _b: i32) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_same(1, 1, 1.0); +LL + two_arg_same(1, 1); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:34:3 + | +LL | two_arg_diff(1, 1, ""); + | ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_diff(1, 1, ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:35:3 + | +LL | two_arg_diff(1, "", ""); + | ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_diff(1, "", ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 4 arguments were supplied + --> $DIR/extra_arguments.rs:36: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:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra arguments + | +LL - two_arg_diff(1, 1, "", ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 4 arguments were supplied + --> $DIR/extra_arguments.rs:37: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:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra arguments + | +LL - two_arg_diff(1, "", 1, ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:40:3 + | +LL | two_arg_same(1, 1, ""); + | ^^^^^^^^^^^^ -- unexpected argument #3 of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:8:4 + | +LL | fn two_arg_same(_a: i32, _b: i32) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_same(1, 1, ""); +LL + two_arg_same(1, 1); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:41:3 + | +LL | two_arg_diff(1, 1, ""); + | ^^^^^^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - two_arg_diff(1, 1, ""); +LL + two_arg_diff(1, ""); + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:42:3 + | +LL | two_arg_same( + | ^^^^^^^^^^^^ +... +LL | "" + | -- unexpected argument #3 of type `&'static str` + | +note: function defined here + --> $DIR/extra_arguments.rs:8:4 + | +LL | fn two_arg_same(_a: i32, _b: i32) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - 1, +LL - "" +LL + 1 + | + +error[E0061]: this function takes 2 arguments but 3 arguments were supplied + --> $DIR/extra_arguments.rs:48:3 + | +LL | two_arg_diff( + | ^^^^^^^^^^^^ +LL | 1, +LL | 1, + | - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:9:4 + | +LL | fn two_arg_diff(_a: i32, _b: &str) {} + | ^^^^^^^^^^^^ +help: remove the extra argument + | +LL - 1, + | + +error[E0061]: this function takes 0 arguments but 2 arguments were supplied + --> $DIR/extra_arguments.rs:13:9 + | +LL | empty($x, 1); + | ^^^^^ - unexpected argument #2 of type `{integer}` +... +LL | foo!(1, ~); + | ---------- + | | | + | | unexpected argument #1 of type `{integer}` + | in this macro invocation + | +note: function defined here + --> $DIR/extra_arguments.rs:6: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:19:9 + | +LL | empty(1, $y); + | ^^^^^ - unexpected argument #1 of type `{integer}` +... +LL | foo!(~, 1); + | ---------- + | | | + | | unexpected argument #2 of type `{integer}` + | in this macro invocation + | +note: function defined here + --> $DIR/extra_arguments.rs:6: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:16:9 + | +LL | empty($x, $y); + | ^^^^^ +... +LL | foo!(1, 1); + | ---------- + | | | | + | | | unexpected argument #2 of type `{integer}` + | | unexpected argument #1 of type `{integer}` + | in this macro invocation + | +note: function defined here + --> $DIR/extra_arguments.rs:6: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:58:3 + | +LL | one_arg(1, panic!()); + | ^^^^^^^ -------- unexpected argument #2 of type `!` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(1, panic!()); +LL + one_arg(1); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:59:3 + | +LL | one_arg(panic!(), 1); + | ^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(panic!(), 1); +LL + one_arg(panic!()); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:60:3 + | +LL | one_arg(stringify!($e), 1); + | ^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(stringify!($e), 1); +LL + one_arg(stringify!($e)); + | + +error[E0061]: this function takes 1 argument but 2 arguments were supplied + --> $DIR/extra_arguments.rs:65:3 + | +LL | one_arg(for _ in 1.. {}, 1); + | ^^^^^^^ - unexpected argument #2 of type `{integer}` + | +note: function defined here + --> $DIR/extra_arguments.rs:7:4 + | +LL | fn one_arg(_a: T) {} + | ^^^^^^^ +help: remove the extra argument + | +LL - one_arg(for _ in 1.. {}, 1); +LL + one_arg(for _ in 1.. {}); + | + +error: aborting due to 22 previous errors + +For more information about this error, try `rustc --explain E0061`. diff --git a/tests/ui/argument-suggestions/extra_arguments.rs b/tests/ui/argument-suggestions/extra_arguments.rs index d8d3339d2ddf6..6e4d850fda900 100644 --- a/tests/ui/argument-suggestions/extra_arguments.rs +++ b/tests/ui/argument-suggestions/extra_arguments.rs @@ -1,4 +1,8 @@ -//@ edition:2015..2021 +//@ revisions: edition2015 edition2018 edition2021 +//@[edition2015]edition:2015 +//@[edition2018]edition:2018 +//@[edition2021]edition:2021.. + fn empty() {} fn one_arg(_a: T) {} fn two_arg_same(_a: i32, _b: i32) {} diff --git a/tests/ui/asm/naked-invalid-attr.stderr b/tests/ui/asm/naked-invalid-attr.edition2015.stderr similarity index 84% rename from tests/ui/asm/naked-invalid-attr.stderr rename to tests/ui/asm/naked-invalid-attr.edition2015.stderr index a6348923277dd..6e3f796352aa2 100644 --- a/tests/ui/asm/naked-invalid-attr.stderr +++ b/tests/ui/asm/naked-invalid-attr.edition2015.stderr @@ -1,11 +1,11 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a` - --> $DIR/naked-invalid-attr.rs:57:5 + --> $DIR/naked-invalid-attr.rs:60:5 | LL | #[::a] | ^ use of unresolved module or unlinked crate `a` error: `#[naked]` attribute cannot be used on crates - --> $DIR/naked-invalid-attr.rs:5:1 + --> $DIR/naked-invalid-attr.rs:8:1 | LL | #![unsafe(naked)] | ^^^^^^^^^^^^^^^^^ @@ -13,7 +13,7 @@ LL | #![unsafe(naked)] = help: `#[naked]` can only be applied to functions error: `#[naked]` attribute cannot be used on foreign functions - --> $DIR/naked-invalid-attr.rs:10:5 + --> $DIR/naked-invalid-attr.rs:13:5 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -21,7 +21,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can be applied to functions and methods error: `#[naked]` attribute cannot be used on structs - --> $DIR/naked-invalid-attr.rs:14:1 + --> $DIR/naked-invalid-attr.rs:17:1 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can only be applied to functions error: `#[naked]` attribute cannot be used on struct fields - --> $DIR/naked-invalid-attr.rs:17:5 + --> $DIR/naked-invalid-attr.rs:20:5 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -37,7 +37,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can only be applied to functions error: `#[naked]` attribute cannot be used on required trait methods - --> $DIR/naked-invalid-attr.rs:23:5 + --> $DIR/naked-invalid-attr.rs:26:5 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -45,7 +45,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can be applied to functions, inherent methods, provided trait methods, and trait methods in impl blocks error: `#[naked]` attribute cannot be used on closures - --> $DIR/naked-invalid-attr.rs:52:5 + --> $DIR/naked-invalid-attr.rs:55:5 | LL | #[unsafe(naked)] | ^^^^^^^^^^^^^^^^ @@ -53,7 +53,7 @@ LL | #[unsafe(naked)] = help: `#[naked]` can be applied to functions and methods error[E0736]: attribute incompatible with `#[unsafe(naked)]` - --> $DIR/naked-invalid-attr.rs:57:3 + --> $DIR/naked-invalid-attr.rs:60:3 | LL | #[::a] | ^^^ the `::a` attribute is incompatible with `#[unsafe(naked)]` diff --git a/tests/ui/asm/naked-invalid-attr.edition2018.stderr b/tests/ui/asm/naked-invalid-attr.edition2018.stderr new file mode 100644 index 0000000000000..74c512e988b96 --- /dev/null +++ b/tests/ui/asm/naked-invalid-attr.edition2018.stderr @@ -0,0 +1,67 @@ +error[E0433]: failed to resolve: could not find `a` in the list of imported crates + --> $DIR/naked-invalid-attr.rs:60:5 + | +LL | #[::a] + | ^ could not find `a` in the list of imported crates + +error: `#[naked]` attribute cannot be used on crates + --> $DIR/naked-invalid-attr.rs:8:1 + | +LL | #![unsafe(naked)] + | ^^^^^^^^^^^^^^^^^ + | + = help: `#[naked]` can only be applied to functions + +error: `#[naked]` attribute cannot be used on foreign functions + --> $DIR/naked-invalid-attr.rs:13:5 + | +LL | #[unsafe(naked)] + | ^^^^^^^^^^^^^^^^ + | + = help: `#[naked]` can be applied to functions and methods + +error: `#[naked]` attribute cannot be used on structs + --> $DIR/naked-invalid-attr.rs:17:1 + | +LL | #[unsafe(naked)] + | ^^^^^^^^^^^^^^^^ + | + = help: `#[naked]` can only be applied to functions + +error: `#[naked]` attribute cannot be used on struct fields + --> $DIR/naked-invalid-attr.rs:20:5 + | +LL | #[unsafe(naked)] + | ^^^^^^^^^^^^^^^^ + | + = help: `#[naked]` can only be applied to functions + +error: `#[naked]` attribute cannot be used on required trait methods + --> $DIR/naked-invalid-attr.rs:26:5 + | +LL | #[unsafe(naked)] + | ^^^^^^^^^^^^^^^^ + | + = help: `#[naked]` can be applied to functions, inherent methods, provided trait methods, and trait methods in impl blocks + +error: `#[naked]` attribute cannot be used on closures + --> $DIR/naked-invalid-attr.rs:55:5 + | +LL | #[unsafe(naked)] + | ^^^^^^^^^^^^^^^^ + | + = help: `#[naked]` can be applied to functions and methods + +error[E0736]: attribute incompatible with `#[unsafe(naked)]` + --> $DIR/naked-invalid-attr.rs:60:3 + | +LL | #[::a] + | ^^^ the `::a` attribute is incompatible with `#[unsafe(naked)]` +... +LL | #[unsafe(naked)] + | ---------------- function marked with `#[unsafe(naked)]` here + +error: aborting due to 8 previous errors + +Some errors have detailed explanations: E0433, E0736. +For more information about an error, try `rustc --explain E0433`. diff --git a/tests/ui/asm/naked-invalid-attr.rs b/tests/ui/asm/naked-invalid-attr.rs index eba7cf01b7b29..ed9628290d948 100644 --- a/tests/ui/asm/naked-invalid-attr.rs +++ b/tests/ui/asm/naked-invalid-attr.rs @@ -2,6 +2,9 @@ // Checks that the #[unsafe(naked)] attribute can be placed on function definitions only. // //@ needs-asm-support +//@ revisions: edition2015 edition2018 +//@ [edition2015] edition: 2015 +//@ [edition2018] edition: 2018.. #![unsafe(naked)] //~ ERROR attribute cannot be used on use std::arch::naked_asm; @@ -56,7 +59,8 @@ fn main() { // Check that the path of an attribute without a name is printed correctly (issue #140082) #[::a] //~^ ERROR attribute incompatible with `#[unsafe(naked)]` -//~| ERROR failed to resolve: use of unresolved module or unlinked crate `a` +//[edition2015]~| ERROR failed to resolve: use of unresolved module or unlinked crate `a` +//[edition2018]~| ERROR failed to resolve: could not find `a` in the list of imported crates #[unsafe(naked)] extern "C" fn issue_140082() { naked_asm!("") diff --git a/tests/ui/associated-consts/associated-const-range-match-patterns.rs b/tests/ui/associated-consts/associated-const-range-match-patterns.rs index 6418ace82f2d4..685cee9618be4 100644 --- a/tests/ui/associated-consts/associated-const-range-match-patterns.rs +++ b/tests/ui/associated-consts/associated-const-range-match-patterns.rs @@ -1,5 +1,7 @@ -//@ edition:2015..2021 -//@ run-pass +//@ revisions: edition2015 edition2018 +//@[edition2015]edition:2015 +//@[edition2018]edition:2018.. +//@run-pass #![allow(dead_code, unreachable_patterns)] #![allow(ellipsis_inclusive_range_patterns)] @@ -13,14 +15,17 @@ impl HasNum for Foo { } fn main() { + #[cfg(edition2015)] assert!(match 2 { Foo::NUM ... 3 => true, _ => false, }); + #[cfg(edition2015)] assert!(match 0 { -1 ... ::NUM => true, _ => false, }); + #[cfg(edition2015)] assert!(match 1 { ::NUM ... ::NUM => true, _ => false, diff --git a/tests/ui/associated-types/associated-types-impl-redirect.rs b/tests/ui/associated-types/associated-types-impl-redirect.rs index 64cae31e5693b..1aecff23d23bf 100644 --- a/tests/ui/associated-types/associated-types-impl-redirect.rs +++ b/tests/ui/associated-types/associated-types-impl-redirect.rs @@ -9,9 +9,6 @@ // for `ByRef`. The right answer was to consider the result ambiguous // until more type information was available. -#![feature(lang_items)] -#![no_implicit_prelude] - use std::marker::Sized; use std::option::Option::{None, Some, self}; diff --git a/tests/ui/associated-types/associated-types-issue-20346.rs b/tests/ui/associated-types/associated-types-issue-20346.rs index c011132619dd8..72af927e19689 100644 --- a/tests/ui/associated-types/associated-types-issue-20346.rs +++ b/tests/ui/associated-types/associated-types-issue-20346.rs @@ -2,7 +2,6 @@ // Test that we reliably check the value of the associated type. #![crate_type = "lib"] -#![no_implicit_prelude] use std::option::Option::{self, None, Some}; use std::vec::Vec; diff --git a/tests/ui/associated-types/associated-types-issue-20346.stderr b/tests/ui/associated-types/associated-types-issue-20346.stderr index d95aeb9afb742..8e6b847b3aac9 100644 --- a/tests/ui/associated-types/associated-types-issue-20346.stderr +++ b/tests/ui/associated-types/associated-types-issue-20346.stderr @@ -1,5 +1,5 @@ error[E0271]: type mismatch resolving ` as Iterator>::Item == Option` - --> $DIR/associated-types-issue-20346.rs:35:36 + --> $DIR/associated-types-issue-20346.rs:34:36 | LL | fn test_adapter>>(it: I) { | - found this type parameter @@ -10,14 +10,14 @@ LL | is_iterator_of::, _>(&adapter); | required by a bound introduced by this call | note: expected this to be `Option` - --> $DIR/associated-types-issue-20346.rs:24:17 + --> $DIR/associated-types-issue-20346.rs:23:17 | LL | type Item = T; | ^ = note: expected enum `Option` found type parameter `T` note: required by a bound in `is_iterator_of` - --> $DIR/associated-types-issue-20346.rs:16:34 + --> $DIR/associated-types-issue-20346.rs:15:34 | LL | fn is_iterator_of>(_: &I) {} | ^^^^^^ required by this bound in `is_iterator_of` diff --git a/tests/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs b/tests/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs index 0de7617943c65..3c1d6de77c436 100644 --- a/tests/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs +++ b/tests/ui/associated-types/associated-types-where-clause-impl-ambiguity.rs @@ -8,9 +8,6 @@ // for `ByRef`. The right answer was to consider the result ambiguous // until more type information was available. -#![feature(lang_items)] -#![no_implicit_prelude] - use std::marker::Sized; use std::option::Option::{None, Some, self}; diff --git a/tests/ui/associated-types/cache/chrono-scan.rs b/tests/ui/associated-types/cache/chrono-scan.rs index f63620a0c3800..b279e1ce5b895 100644 --- a/tests/ui/associated-types/cache/chrono-scan.rs +++ b/tests/ui/associated-types/cache/chrono-scan.rs @@ -21,7 +21,7 @@ pub fn timezone_offset_zulu(s: &str, colon: F) -> ParseResult<(&str, i32)> pub fn parse<'a, I>(mut s: &str, items: I) -> ParseResult<()> where I: Iterator> { macro_rules! try_consume { - ($e:expr) => ({ let (s_, v) = try!($e); s = s_; v }) + ($e:expr) => ({ let (s_, v) = $e?; s = s_; v }) } let offset = try_consume!(timezone_offset_zulu(s.trim_start(), colon_or_space)); let offset = try_consume!(timezone_offset_zulu(s.trim_start(), colon_or_space)); diff --git a/tests/ui/associated-types/issue-43924.stderr b/tests/ui/associated-types/issue-43924.edition2015.stderr similarity index 90% rename from tests/ui/associated-types/issue-43924.stderr rename to tests/ui/associated-types/issue-43924.edition2015.stderr index 196ad85f084e2..a695421d68548 100644 --- a/tests/ui/associated-types/issue-43924.stderr +++ b/tests/ui/associated-types/issue-43924.edition2015.stderr @@ -1,17 +1,17 @@ error[E0277]: the trait bound `(dyn ToString + 'static): Default` is not satisfied - --> $DIR/issue-43924.rs:8:45 + --> $DIR/issue-43924.rs:10:45 | LL | type Out: Default + ToString + ?Sized = dyn ToString; | ^^^^^^^^^^^^ the trait `Default` is not implemented for `(dyn ToString + 'static)` | note: required by a bound in `Foo::Out` - --> $DIR/issue-43924.rs:8:15 + --> $DIR/issue-43924.rs:10:15 | LL | type Out: Default + ToString + ?Sized = dyn ToString; | ^^^^^^^ required by this bound in `Foo::Out` error[E0599]: no function or associated item named `default` found for trait object `(dyn ToString + 'static)` in the current scope - --> $DIR/issue-43924.rs:15:39 + --> $DIR/issue-43924.rs:17:39 | LL | assert_eq!(<() as Foo>::Out::default().to_string(), "false"); | ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)` diff --git a/tests/ui/associated-types/issue-43924.edition2021.stderr b/tests/ui/associated-types/issue-43924.edition2021.stderr new file mode 100644 index 0000000000000..abe9218da7217 --- /dev/null +++ b/tests/ui/associated-types/issue-43924.edition2021.stderr @@ -0,0 +1,22 @@ +error[E0277]: the trait bound `(dyn ToString + 'static): Default` is not satisfied + --> $DIR/issue-43924.rs:10:45 + | +LL | type Out: Default + ToString + ?Sized = dyn ToString; + | ^^^^^^^^^^^^ the trait `Default` is not implemented for `(dyn ToString + 'static)` + | +note: required by a bound in `Foo::Out` + --> $DIR/issue-43924.rs:10:15 + | +LL | type Out: Default + ToString + ?Sized = dyn ToString; + | ^^^^^^^ required by this bound in `Foo::Out` + +error[E0599]: no function or associated item named `default` found for trait `(dyn ToString + 'static)` + --> $DIR/issue-43924.rs:17:39 + | +LL | assert_eq!(<() as Foo>::Out::default().to_string(), "false"); + | ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)` + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0277, E0599. +For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/associated-types/issue-43924.rs b/tests/ui/associated-types/issue-43924.rs index 63ebbddea76ff..377e1d98637ee 100644 --- a/tests/ui/associated-types/issue-43924.rs +++ b/tests/ui/associated-types/issue-43924.rs @@ -1,4 +1,6 @@ -//@ edition:2015..2021 +//@ revisions: edition2015 edition2021 +//@[edition2015]edition:2015..2021 +//@[edition2021]edition:2021.. #![feature(associated_type_defaults)] // This used to cause an ICE because assoc. type defaults weren't properly @@ -13,5 +15,5 @@ impl Foo for () {} fn main() { assert_eq!(<() as Foo>::Out::default().to_string(), "false"); - //~^ ERROR no function or associated item named `default` found for trait object + //~^ ERROR no function or associated item named `default` found for trait } diff --git a/tests/ui/async-await/issue-65634-raw-ident-suggestion.rs b/tests/ui/async-await/issue-65634-raw-ident-suggestion.rs index 98f5b6dd9f98e..b6423e869ed25 100644 --- a/tests/ui/async-await/issue-65634-raw-ident-suggestion.rs +++ b/tests/ui/async-await/issue-65634-raw-ident-suggestion.rs @@ -1,6 +1,6 @@ //@ revisions: edition2015 edition2018 //@[edition2015]edition:2015 -//@[edition2018]edition:2018 +//@[edition2018]edition:2018.. #![allow(non_camel_case_types)] diff --git a/tests/ui/attributes/field-attributes-vis-unresolved.stderr b/tests/ui/attributes/field-attributes-vis-unresolved.edition2015.stderr similarity index 89% rename from tests/ui/attributes/field-attributes-vis-unresolved.stderr rename to tests/ui/attributes/field-attributes-vis-unresolved.edition2015.stderr index 1ebfde4cd67e3..29bbe2e7347ee 100644 --- a/tests/ui/attributes/field-attributes-vis-unresolved.stderr +++ b/tests/ui/attributes/field-attributes-vis-unresolved.edition2015.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent` - --> $DIR/field-attributes-vis-unresolved.rs:18:12 + --> $DIR/field-attributes-vis-unresolved.rs:20:12 | LL | pub(in nonexistent) field: u8 | ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent` @@ -10,7 +10,7 @@ LL + extern crate nonexistent; | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent` - --> $DIR/field-attributes-vis-unresolved.rs:23:12 + --> $DIR/field-attributes-vis-unresolved.rs:26:12 | LL | pub(in nonexistent) u8 | ^^^^^^^^^^^ use of unresolved module or unlinked crate `nonexistent` diff --git a/tests/ui/attributes/field-attributes-vis-unresolved.edition2018.stderr b/tests/ui/attributes/field-attributes-vis-unresolved.edition2018.stderr new file mode 100644 index 0000000000000..1fa8a57067617 --- /dev/null +++ b/tests/ui/attributes/field-attributes-vis-unresolved.edition2018.stderr @@ -0,0 +1,14 @@ +error: relative paths are not supported in visibilities in 2018 edition or later + --> $DIR/field-attributes-vis-unresolved.rs:20:12 + | +LL | pub(in nonexistent) field: u8 + | ^^^^^^^^^^^ help: try: `crate::nonexistent` + +error: relative paths are not supported in visibilities in 2018 edition or later + --> $DIR/field-attributes-vis-unresolved.rs:26:12 + | +LL | pub(in nonexistent) u8 + | ^^^^^^^^^^^ help: try: `crate::nonexistent` + +error: aborting due to 2 previous errors + diff --git a/tests/ui/attributes/field-attributes-vis-unresolved.rs b/tests/ui/attributes/field-attributes-vis-unresolved.rs index be710a3cd744c..ea3bd5d431f8a 100644 --- a/tests/ui/attributes/field-attributes-vis-unresolved.rs +++ b/tests/ui/attributes/field-attributes-vis-unresolved.rs @@ -1,4 +1,6 @@ -//@ edition:2015 +//@ revisions: edition2015 edition2018 +//@[edition2015]edition:2015 +//@[edition2018]edition:2018.. // Non-builtin attributes do not mess with field visibility resolution (issue #67006). mod internal { @@ -15,12 +17,14 @@ mod internal { struct S { #[rustfmt::skip] - pub(in nonexistent) field: u8 //~ ERROR failed to resolve + pub(in nonexistent) field: u8 //[edition2015]~ ERROR failed to resolve + //[edition2018]~^ ERROR relative paths are not supported in visibilities in 2018 edition or later } struct Z( #[rustfmt::skip] - pub(in nonexistent) u8 //~ ERROR failed to resolve + pub(in nonexistent) u8 //[edition2015]~ ERROR failed to resolve + //[edition2018]~^ ERROR relative paths are not supported in visibilities in 2018 edition or later ); fn main() {}