diff options
Diffstat (limited to 'src/test/ui')
41 files changed, 188 insertions, 140 deletions
diff --git a/src/test/ui/bad/bad-mid-path-type-params.rs b/src/test/ui/bad/bad-mid-path-type-params.rs index 20ac757354f..1ee70d9bdde 100644 --- a/src/test/ui/bad/bad-mid-path-type-params.rs +++ b/src/test/ui/bad/bad-mid-path-type-params.rs @@ -38,16 +38,16 @@ impl Trait<isize> for S2 { fn foo<'a>() { let _ = S::new::<isize,f64>(1, 1.0); - //~^ ERROR too many type parameters provided + //~^ ERROR wrong number of type arguments let _ = S::<'a,isize>::new::<f64>(1, 1.0); - //~^ ERROR wrong number of lifetime parameters + //~^ ERROR wrong number of lifetime arguments let _: S2 = Trait::new::<isize,f64>(1, 1.0); - //~^ ERROR too many type parameters provided + //~^ ERROR wrong number of type arguments let _: S2 = Trait::<'a,isize>::new::<f64>(1, 1.0); - //~^ ERROR too many lifetime parameters provided + //~^ ERROR wrong number of lifetime arguments } fn main() {} diff --git a/src/test/ui/bad/bad-mid-path-type-params.stderr b/src/test/ui/bad/bad-mid-path-type-params.stderr index d2b002ebee9..7901f1f0fba 100644 --- a/src/test/ui/bad/bad-mid-path-type-params.stderr +++ b/src/test/ui/bad/bad-mid-path-type-params.stderr @@ -1,26 +1,26 @@ -error[E0087]: too many type parameters provided: expected at most 1 type parameter, found 2 type parameters +error[E0087]: wrong number of type arguments: expected 1, found 2 --> $DIR/bad-mid-path-type-params.rs:40:28 | LL | let _ = S::new::<isize,f64>(1, 1.0); - | ^^^ expected 1 type parameter + | ^^^ unexpected type argument -error[E0107]: wrong number of lifetime parameters: expected 0, found 1 - --> $DIR/bad-mid-path-type-params.rs:43:13 +error[E0107]: wrong number of lifetime arguments: expected 0, found 1 + --> $DIR/bad-mid-path-type-params.rs:43:17 | LL | let _ = S::<'a,isize>::new::<f64>(1, 1.0); - | ^^^^^^^^^^^^^^^^^^^^^^^^^ unexpected lifetime parameter + | ^^ unexpected lifetime argument -error[E0087]: too many type parameters provided: expected at most 1 type parameter, found 2 type parameters +error[E0087]: wrong number of type arguments: expected 1, found 2 --> $DIR/bad-mid-path-type-params.rs:46:36 | LL | let _: S2 = Trait::new::<isize,f64>(1, 1.0); - | ^^^ expected 1 type parameter + | ^^^ unexpected type argument -error[E0088]: too many lifetime parameters provided: expected at most 0 lifetime parameters, found 1 lifetime parameter +error[E0088]: wrong number of lifetime arguments: expected 0, found 1 --> $DIR/bad-mid-path-type-params.rs:49:25 | LL | let _: S2 = Trait::<'a,isize>::new::<f64>(1, 1.0); - | ^^ expected 0 lifetime parameters + | ^^ unexpected lifetime argument error: aborting due to 4 previous errors diff --git a/src/test/ui/constructor-lifetime-args.rs b/src/test/ui/constructor-lifetime-args.rs index 50db9707355..1fe50cfebba 100644 --- a/src/test/ui/constructor-lifetime-args.rs +++ b/src/test/ui/constructor-lifetime-args.rs @@ -25,12 +25,12 @@ enum E<'a, 'b> { fn main() { S(&0, &0); // OK S::<'static>(&0, &0); - //~^ ERROR expected 2 lifetime parameters, found 1 lifetime parameter + //~^ ERROR wrong number of lifetime arguments: expected 2, found 1 S::<'static, 'static, 'static>(&0, &0); - //~^ ERROR expected at most 2 lifetime parameters, found 3 lifetime parameters + //~^ ERROR wrong number of lifetime arguments: expected 2, found 3 E::V(&0); // OK E::V::<'static>(&0); - //~^ ERROR expected 2 lifetime parameters, found 1 lifetime parameter + //~^ ERROR wrong number of lifetime arguments: expected 2, found 1 E::V::<'static, 'static, 'static>(&0); - //~^ ERROR expected at most 2 lifetime parameters, found 3 lifetime parameters + //~^ ERROR wrong number of lifetime arguments: expected 2, found 3 } diff --git a/src/test/ui/constructor-lifetime-args.stderr b/src/test/ui/constructor-lifetime-args.stderr index 1710594d255..cf3ad9ae8ec 100644 --- a/src/test/ui/constructor-lifetime-args.stderr +++ b/src/test/ui/constructor-lifetime-args.stderr @@ -1,26 +1,26 @@ -error[E0090]: too few lifetime parameters provided: expected 2 lifetime parameters, found 1 lifetime parameter +error[E0090]: wrong number of lifetime arguments: expected 2, found 1 --> $DIR/constructor-lifetime-args.rs:27:5 | LL | S::<'static>(&0, &0); - | ^^^^^^^^^^^^ expected 2 lifetime parameters + | ^^^^^^^^^^^^ expected 2 lifetime arguments -error[E0088]: too many lifetime parameters provided: expected at most 2 lifetime parameters, found 3 lifetime parameters +error[E0088]: wrong number of lifetime arguments: expected 2, found 3 --> $DIR/constructor-lifetime-args.rs:29:27 | LL | S::<'static, 'static, 'static>(&0, &0); - | ^^^^^^^ expected 2 lifetime parameters + | ^^^^^^^ unexpected lifetime argument -error[E0090]: too few lifetime parameters provided: expected 2 lifetime parameters, found 1 lifetime parameter +error[E0090]: wrong number of lifetime arguments: expected 2, found 1 --> $DIR/constructor-lifetime-args.rs:32:5 | LL | E::V::<'static>(&0); - | ^^^^^^^^^^^^^^^ expected 2 lifetime parameters + | ^^^^^^^^^^^^^^^ expected 2 lifetime arguments -error[E0088]: too many lifetime parameters provided: expected at most 2 lifetime parameters, found 3 lifetime parameters +error[E0088]: wrong number of lifetime arguments: expected 2, found 3 --> $DIR/constructor-lifetime-args.rs:34:30 | LL | E::V::<'static, 'static, 'static>(&0); - | ^^^^^^^ expected 2 lifetime parameters + | ^^^^^^^ unexpected lifetime argument error: aborting due to 4 previous errors diff --git a/src/test/ui/error-codes/E0087.rs b/src/test/ui/error-codes/E0087.rs index 6dc08860614..bea76f34220 100644 --- a/src/test/ui/error-codes/E0087.rs +++ b/src/test/ui/error-codes/E0087.rs @@ -12,7 +12,7 @@ fn foo() {} fn bar<T>() {} fn main() { - foo::<f64>(); //~ ERROR expected at most 0 type parameters, found 1 type parameter [E0087] + foo::<f64>(); //~ ERROR wrong number of type arguments: expected 0, found 1 [E0087] - bar::<f64, u64>(); //~ ERROR expected at most 1 type parameter, found 2 type parameters [E0087] + bar::<f64, u64>(); //~ ERROR wrong number of type arguments: expected 1, found 2 [E0087] } diff --git a/src/test/ui/error-codes/E0087.stderr b/src/test/ui/error-codes/E0087.stderr index cd1e99e7b41..a07f1bbf39a 100644 --- a/src/test/ui/error-codes/E0087.stderr +++ b/src/test/ui/error-codes/E0087.stderr @@ -1,14 +1,14 @@ -error[E0087]: too many type parameters provided: expected at most 0 type parameters, found 1 type parameter +error[E0087]: wrong number of type arguments: expected 0, found 1 --> $DIR/E0087.rs:15:11 | -LL | foo::<f64>(); //~ ERROR expected at most 0 type parameters, found 1 type parameter [E0087] - | ^^^ expected 0 type parameters +LL | foo::<f64>(); //~ ERROR wrong number of type arguments: expected 0, found 1 [E0087] + | ^^^ unexpected type argument -error[E0087]: too many type parameters provided: expected at most 1 type parameter, found 2 type parameters +error[E0087]: wrong number of type arguments: expected 1, found 2 --> $DIR/E0087.rs:17:16 | -LL | bar::<f64, u64>(); //~ ERROR expected at most 1 type parameter, found 2 type parameters [E0087] - | ^^^ expected 1 type parameter +LL | bar::<f64, u64>(); //~ ERROR wrong number of type arguments: expected 1, found 2 [E0087] + | ^^^ unexpected type argument error: aborting due to 2 previous errors diff --git a/src/test/ui/error-codes/E0088.stderr b/src/test/ui/error-codes/E0088.stderr index 4bf2760994e..6b956023e05 100644 --- a/src/test/ui/error-codes/E0088.stderr +++ b/src/test/ui/error-codes/E0088.stderr @@ -1,14 +1,14 @@ -error[E0088]: too many lifetime parameters provided: expected at most 0 lifetime parameters, found 1 lifetime parameter +error[E0088]: wrong number of lifetime arguments: expected 0, found 1 --> $DIR/E0088.rs:15:9 | LL | f::<'static>(); //~ ERROR E0088 - | ^^^^^^^ expected 0 lifetime parameters + | ^^^^^^^ unexpected lifetime argument -error[E0088]: too many lifetime parameters provided: expected at most 1 lifetime parameter, found 2 lifetime parameters +error[E0088]: wrong number of lifetime arguments: expected 1, found 2 --> $DIR/E0088.rs:16:18 | LL | g::<'static, 'static>(); //~ ERROR E0088 - | ^^^^^^^ expected 1 lifetime parameter + | ^^^^^^^ unexpected lifetime argument error: aborting due to 2 previous errors diff --git a/src/test/ui/error-codes/E0089.rs b/src/test/ui/error-codes/E0089.rs index 21df9abd093..4e6196a7b89 100644 --- a/src/test/ui/error-codes/E0089.rs +++ b/src/test/ui/error-codes/E0089.rs @@ -11,5 +11,5 @@ fn foo<T, U>() {} fn main() { - foo::<f64>(); //~ ERROR expected 2 type parameters, found 1 type parameter [E0089] + foo::<f64>(); //~ ERROR wrong number of type arguments: expected 2, found 1 [E0089] } diff --git a/src/test/ui/error-codes/E0089.stderr b/src/test/ui/error-codes/E0089.stderr index 0b95033fb36..f79c478b733 100644 --- a/src/test/ui/error-codes/E0089.stderr +++ b/src/test/ui/error-codes/E0089.stderr @@ -1,8 +1,8 @@ -error[E0089]: too few type parameters provided: expected 2 type parameters, found 1 type parameter +error[E0089]: wrong number of type arguments: expected 2, found 1 --> $DIR/E0089.rs:14:5 | -LL | foo::<f64>(); //~ ERROR expected 2 type parameters, found 1 type parameter [E0089] - | ^^^^^^^^^^ expected 2 type parameters +LL | foo::<f64>(); //~ ERROR wrong number of type arguments: expected 2, found 1 [E0089] + | ^^^^^^^^^^ expected 2 type arguments error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0090.rs b/src/test/ui/error-codes/E0090.rs index 13b2131cc8b..26be4c12f07 100644 --- a/src/test/ui/error-codes/E0090.rs +++ b/src/test/ui/error-codes/E0090.rs @@ -11,5 +11,5 @@ fn foo<'a: 'b, 'b: 'a>() {} fn main() { - foo::<'static>(); //~ ERROR expected 2 lifetime parameters, found 1 lifetime parameter [E0090] + foo::<'static>(); //~ ERROR wrong number of lifetime arguments: expected 2, found 1 [E0090] } diff --git a/src/test/ui/error-codes/E0090.stderr b/src/test/ui/error-codes/E0090.stderr index f119d5fa467..9029b6c2708 100644 --- a/src/test/ui/error-codes/E0090.stderr +++ b/src/test/ui/error-codes/E0090.stderr @@ -1,8 +1,8 @@ -error[E0090]: too few lifetime parameters provided: expected 2 lifetime parameters, found 1 lifetime parameter +error[E0090]: wrong number of lifetime arguments: expected 2, found 1 --> $DIR/E0090.rs:14:5 | -LL | foo::<'static>(); //~ ERROR expected 2 lifetime parameters, found 1 lifetime parameter [E0090] - | ^^^^^^^^^^^^^^ expected 2 lifetime parameters +LL | foo::<'static>(); //~ ERROR wrong number of lifetime arguments: expected 2, found 1 [E0090] + | ^^^^^^^^^^^^^^ expected 2 lifetime arguments error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0107.rs b/src/test/ui/error-codes/E0107.rs index 16ebd3e9ca5..815c7fefd2a 100644 --- a/src/test/ui/error-codes/E0107.rs +++ b/src/test/ui/error-codes/E0107.rs @@ -20,14 +20,13 @@ enum Bar { struct Baz<'a, 'b, 'c> { buzz: Buzz<'a>, //~^ ERROR E0107 - //~| expected 2 lifetime parameters + //~| expected 2 lifetime arguments bar: Bar<'a>, //~^ ERROR E0107 - //~| unexpected lifetime parameter + //~| unexpected lifetime argument foo2: Foo<'a, 'b, 'c>, //~^ ERROR E0107 - //~| 2 unexpected lifetime parameters + //~| 2 unexpected lifetime arguments } -fn main() { -} +fn main() {} diff --git a/src/test/ui/error-codes/E0107.stderr b/src/test/ui/error-codes/E0107.stderr index 76bb2667643..497fa91bd4f 100644 --- a/src/test/ui/error-codes/E0107.stderr +++ b/src/test/ui/error-codes/E0107.stderr @@ -1,20 +1,20 @@ -error[E0107]: wrong number of lifetime parameters: expected 2, found 1 +error[E0107]: wrong number of lifetime arguments: expected 2, found 1 --> $DIR/E0107.rs:21:11 | LL | buzz: Buzz<'a>, - | ^^^^^^^^ expected 2 lifetime parameters + | ^^^^^^^^ expected 2 lifetime arguments -error[E0107]: wrong number of lifetime parameters: expected 0, found 1 - --> $DIR/E0107.rs:24:10 +error[E0107]: wrong number of lifetime arguments: expected 0, found 1 + --> $DIR/E0107.rs:24:14 | LL | bar: Bar<'a>, - | ^^^^^^^ unexpected lifetime parameter + | ^^ unexpected lifetime argument -error[E0107]: wrong number of lifetime parameters: expected 1, found 3 +error[E0107]: wrong number of lifetime arguments: expected 1, found 3 --> $DIR/E0107.rs:27:11 | LL | foo2: Foo<'a, 'b, 'c>, - | ^^^^^^^^^^^^^^^ 2 unexpected lifetime parameters + | ^^^^^^^^^^^^^^^ 2 unexpected lifetime arguments error: aborting due to 3 previous errors diff --git a/src/test/ui/error-codes/E0244.stderr b/src/test/ui/error-codes/E0244.stderr index e3239703962..87f063c604f 100644 --- a/src/test/ui/error-codes/E0244.stderr +++ b/src/test/ui/error-codes/E0244.stderr @@ -2,7 +2,7 @@ error[E0244]: wrong number of type arguments: expected 0, found 2 --> $DIR/E0244.rs:12:23 | LL | struct Bar<S, T> { x: Foo<S, T> } - | ^^^^^^^^^ expected no type arguments + | ^^^^^^^^^ 2 unexpected type arguments error: aborting due to previous error diff --git a/src/test/ui/generic/generic-arg-mismatch-recover.rs b/src/test/ui/generic/generic-arg-mismatch-recover.rs new file mode 100644 index 00000000000..b8883ff9c83 --- /dev/null +++ b/src/test/ui/generic/generic-arg-mismatch-recover.rs @@ -0,0 +1,21 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo<'a, T: 'a>(&'a T); + +struct Bar<'a>(&'a ()); + +fn main() { + Foo::<'static, 'static, ()>(&0); //~ ERROR wrong number of lifetime arguments + //~^ ERROR mismatched types + + Bar::<'static, 'static, ()>(&()); //~ ERROR wrong number of lifetime arguments + //~^ ERROR wrong number of type arguments +} diff --git a/src/test/ui/generic/generic-arg-mismatch-recover.stderr b/src/test/ui/generic/generic-arg-mismatch-recover.stderr new file mode 100644 index 00000000000..81869ad0d08 --- /dev/null +++ b/src/test/ui/generic/generic-arg-mismatch-recover.stderr @@ -0,0 +1,31 @@ +error[E0088]: wrong number of lifetime arguments: expected 1, found 2 + --> $DIR/generic-arg-mismatch-recover.rs:16:20 + | +LL | Foo::<'static, 'static, ()>(&0); //~ ERROR wrong number of lifetime arguments + | ^^^^^^^ unexpected lifetime argument + +error[E0308]: mismatched types + --> $DIR/generic-arg-mismatch-recover.rs:16:33 + | +LL | Foo::<'static, 'static, ()>(&0); //~ ERROR wrong number of lifetime arguments + | ^^ expected (), found integral variable + | + = note: expected type `&'static ()` + found type `&{integer}` + +error[E0088]: wrong number of lifetime arguments: expected 1, found 2 + --> $DIR/generic-arg-mismatch-recover.rs:19:20 + | +LL | Bar::<'static, 'static, ()>(&()); //~ ERROR wrong number of lifetime arguments + | ^^^^^^^ unexpected lifetime argument + +error[E0087]: wrong number of type arguments: expected 0, found 1 + --> $DIR/generic-arg-mismatch-recover.rs:19:29 + | +LL | Bar::<'static, 'static, ()>(&()); //~ ERROR wrong number of lifetime arguments + | ^^ unexpected type argument + +error: aborting due to 4 previous errors + +Some errors occurred: E0087, E0088, E0308. +For more information about an error, try `rustc --explain E0087`. diff --git a/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr b/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr index 6b54baefb1d..b614da88ba1 100644 --- a/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr +++ b/src/test/ui/generic/generic-impl-more-params-with-defaults.stderr @@ -2,7 +2,7 @@ error[E0244]: wrong number of type arguments: expected at most 2, found 3 --> $DIR/generic-impl-more-params-with-defaults.rs:23:5 | LL | Vec::<isize, Heap, bool>::new(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type arguments + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type argument error: aborting due to previous error diff --git a/src/test/ui/generic/generic-type-more-params-with-defaults.stderr b/src/test/ui/generic/generic-type-more-params-with-defaults.stderr index 684a22ce45c..f226921816d 100644 --- a/src/test/ui/generic/generic-type-more-params-with-defaults.stderr +++ b/src/test/ui/generic/generic-type-more-params-with-defaults.stderr @@ -2,7 +2,7 @@ error[E0244]: wrong number of type arguments: expected at most 2, found 3 --> $DIR/generic-type-more-params-with-defaults.rs:19:12 | LL | let _: Vec<isize, Heap, bool>; - | ^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type arguments + | ^^^^^^^^^^^^^^^^^^^^^^ expected at most 2 type argument error: aborting due to previous error diff --git a/src/test/ui/issue-53251.rs b/src/test/ui/issue-53251.rs index aa9da744566..8c75ea45a61 100644 --- a/src/test/ui/issue-53251.rs +++ b/src/test/ui/issue-53251.rs @@ -19,10 +19,12 @@ macro_rules! impl_add { $( fn $n() { S::f::<i64>(); - //~^ ERROR too many type parameters provided + //~^ ERROR wrong number of type arguments } )* } } impl_add!(a b); + +fn main() {} diff --git a/src/test/ui/issue-53251.stderr b/src/test/ui/issue-53251.stderr index bf99e73f0d9..f12afa4a792 100644 --- a/src/test/ui/issue-53251.stderr +++ b/src/test/ui/issue-53251.stderr @@ -1,17 +1,12 @@ -error[E0601]: `main` function not found in crate `issue_53251` - | - = note: consider adding a `main` function to `$DIR/issue-53251.rs` - -error[E0087]: too many type parameters provided: expected at most 0 type parameters, found 1 type parameter +error[E0087]: wrong number of type arguments: expected 0, found 1 --> $DIR/issue-53251.rs:21:24 | LL | S::f::<i64>(); - | ^^^ expected 0 type parameters + | ^^^ unexpected type argument ... LL | impl_add!(a b); | --------------- in this macro invocation -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors occurred: E0087, E0601. -For more information about an error, try `rustc --explain E0087`. +For more information about this error, try `rustc --explain E0087`. diff --git a/src/test/ui/issues/issue-18423.rs b/src/test/ui/issues/issue-18423.rs index 5945a7a1c9a..f550dc6f310 100644 --- a/src/test/ui/issues/issue-18423.rs +++ b/src/test/ui/issues/issue-18423.rs @@ -8,10 +8,10 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// Test that `Box` cannot be used with a lifetime parameter. +// Test that `Box` cannot be used with a lifetime argument. struct Foo<'a> { - x: Box<'a, isize> //~ ERROR wrong number of lifetime parameters + x: Box<'a, isize> //~ ERROR wrong number of lifetime arguments } pub fn main() { diff --git a/src/test/ui/issues/issue-18423.stderr b/src/test/ui/issues/issue-18423.stderr index 25406198193..49afd513092 100644 --- a/src/test/ui/issues/issue-18423.stderr +++ b/src/test/ui/issues/issue-18423.stderr @@ -1,8 +1,8 @@ -error[E0107]: wrong number of lifetime parameters: expected 0, found 1 - --> $DIR/issue-18423.rs:14:8 +error[E0107]: wrong number of lifetime arguments: expected 0, found 1 + --> $DIR/issue-18423.rs:14:12 | -LL | x: Box<'a, isize> //~ ERROR wrong number of lifetime parameters - | ^^^^^^^^^^^^^^ unexpected lifetime parameter +LL | x: Box<'a, isize> //~ ERROR wrong number of lifetime arguments + | ^^ unexpected lifetime argument error: aborting due to previous error diff --git a/src/test/ui/issues/issue-3214.stderr b/src/test/ui/issues/issue-3214.stderr index 1298e4a007d..2c4b9f84105 100644 --- a/src/test/ui/issues/issue-3214.stderr +++ b/src/test/ui/issues/issue-3214.stderr @@ -10,10 +10,10 @@ LL | x: T, //~ ERROR can't use type parameters from outer function | ^ use of type variable from outer function error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/issue-3214.rs:16:22 + --> $DIR/issue-3214.rs:16:26 | LL | impl<T> Drop for foo<T> { - | ^^^^^^ expected no type arguments + | ^ unexpected type argument error: aborting due to 2 previous errors diff --git a/src/test/ui/methods/method-call-lifetime-args-fail.rs b/src/test/ui/methods/method-call-lifetime-args-fail.rs index f0a87c74703..980ada9020c 100644 --- a/src/test/ui/methods/method-call-lifetime-args-fail.rs +++ b/src/test/ui/methods/method-call-lifetime-args-fail.rs @@ -24,9 +24,9 @@ impl S { fn method_call() { S.early(); // OK S.early::<'static>(); - //~^ ERROR expected 2 lifetime parameters, found 1 lifetime parameter + //~^ ERROR wrong number of lifetime arguments: expected 2, found 1 S.early::<'static, 'static, 'static>(); - //~^ ERROR expected at most 2 lifetime parameters, found 3 lifetime parameters + //~^ ERROR wrong number of lifetime arguments: expected 2, found 3 let _: &u8 = S.life_and_type::<'static>(); S.life_and_type::<u8>(); S.life_and_type::<'static, u8>(); @@ -71,9 +71,9 @@ fn ufcs() { S::early(S); // OK S::early::<'static>(S); - //~^ ERROR expected 2 lifetime parameters, found 1 lifetime parameter + //~^ ERROR wrong number of lifetime arguments: expected 2, found 1 S::early::<'static, 'static, 'static>(S); - //~^ ERROR expected at most 2 lifetime parameters, found 3 lifetime parameters + //~^ ERROR wrong number of lifetime arguments: expected 2, found 3 let _: &u8 = S::life_and_type::<'static>(S); S::life_and_type::<u8>(S); S::life_and_type::<'static, u8>(S); diff --git a/src/test/ui/methods/method-call-lifetime-args-fail.stderr b/src/test/ui/methods/method-call-lifetime-args-fail.stderr index 3814f4b5065..d86a9f48e00 100644 --- a/src/test/ui/methods/method-call-lifetime-args-fail.stderr +++ b/src/test/ui/methods/method-call-lifetime-args-fail.stderr @@ -1,14 +1,14 @@ -error[E0090]: too few lifetime parameters provided: expected 2 lifetime parameters, found 1 lifetime parameter +error[E0090]: wrong number of lifetime arguments: expected 2, found 1 --> $DIR/method-call-lifetime-args-fail.rs:26:7 | LL | S.early::<'static>(); - | ^^^^^ expected 2 lifetime parameters + | ^^^^^ expected 2 lifetime arguments -error[E0088]: too many lifetime parameters provided: expected at most 2 lifetime parameters, found 3 lifetime parameters +error[E0088]: wrong number of lifetime arguments: expected 2, found 3 --> $DIR/method-call-lifetime-args-fail.rs:28:33 | LL | S.early::<'static, 'static, 'static>(); - | ^^^^^^^ expected 2 lifetime parameters + | ^^^^^^^ unexpected lifetime argument error: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present --> $DIR/method-call-lifetime-args-fail.rs:37:15 @@ -178,17 +178,17 @@ note: the late bound lifetime parameter is introduced here LL | fn late_unused_early<'a, 'b>(self) -> &'b u8 { loop {} } | ^^ -error[E0090]: too few lifetime parameters provided: expected 2 lifetime parameters, found 1 lifetime parameter +error[E0090]: wrong number of lifetime arguments: expected 2, found 1 --> $DIR/method-call-lifetime-args-fail.rs:73:5 | LL | S::early::<'static>(S); - | ^^^^^^^^^^^^^^^^^^^ expected 2 lifetime parameters + | ^^^^^^^^^^^^^^^^^^^ expected 2 lifetime arguments -error[E0088]: too many lifetime parameters provided: expected at most 2 lifetime parameters, found 3 lifetime parameters +error[E0088]: wrong number of lifetime arguments: expected 2, found 3 --> $DIR/method-call-lifetime-args-fail.rs:75:34 | LL | S::early::<'static, 'static, 'static>(S); - | ^^^^^^^ expected 2 lifetime parameters + | ^^^^^^^ unexpected lifetime argument error: aborting due to 18 previous errors diff --git a/src/test/ui/seq-args.stderr b/src/test/ui/seq-args.stderr index dc9d0a7fc0b..068f08eebe7 100644 --- a/src/test/ui/seq-args.stderr +++ b/src/test/ui/seq-args.stderr @@ -1,14 +1,14 @@ error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/seq-args.rs:14:9 + --> $DIR/seq-args.rs:14:13 | LL | impl<T> seq<T> for Vec<T> { //~ ERROR wrong number of type arguments - | ^^^^^^ expected no type arguments + | ^ unexpected type argument error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/seq-args.rs:17:6 + --> $DIR/seq-args.rs:17:10 | LL | impl seq<bool> for u32 { //~ ERROR wrong number of type arguments - | ^^^^^^^^^ expected no type arguments + | ^^^^ unexpected type argument error: aborting due to 2 previous errors diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.stderr b/src/test/ui/structs/structure-constructor-type-mismatch.stderr index 1a88bc09dd6..dfa219e0872 100644 --- a/src/test/ui/structs/structure-constructor-type-mismatch.stderr +++ b/src/test/ui/structs/structure-constructor-type-mismatch.stderr @@ -71,10 +71,10 @@ LL | x: 7, found type `{integer}` error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/structure-constructor-type-mismatch.rs:58:15 + --> $DIR/structure-constructor-type-mismatch.rs:58:24 | LL | let pt3 = PointF::<i32> { //~ ERROR wrong number of type arguments - | ^^^^^^^^^^^^^ expected no type arguments + | ^^^ unexpected type argument error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:59:12 @@ -101,10 +101,10 @@ LL | y: 10, //~ ERROR mismatched types found type `{integer}` error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/structure-constructor-type-mismatch.rs:64:9 + --> $DIR/structure-constructor-type-mismatch.rs:64:18 | LL | PointF::<u32> { .. } => {} //~ ERROR wrong number of type arguments - | ^^^^^^^^^^^^^ expected no type arguments + | ^^^ unexpected type argument error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:64:9 diff --git a/src/test/ui/traits/trait-object-vs-lifetime.rs b/src/test/ui/traits/trait-object-vs-lifetime.rs index a70141edc29..954e20e3345 100644 --- a/src/test/ui/traits/trait-object-vs-lifetime.rs +++ b/src/test/ui/traits/trait-object-vs-lifetime.rs @@ -21,7 +21,7 @@ fn main() { let _: S<'static, 'static +>; //~^ at least one non-builtin trait is required for an object type let _: S<'static, 'static>; - //~^ ERROR wrong number of lifetime parameters: expected 1, found 2 + //~^ ERROR wrong number of lifetime arguments: expected 1, found 2 //~| ERROR wrong number of type arguments: expected 1, found 0 let _: S<'static +, 'static>; //~^ ERROR lifetime parameters must be declared prior to type parameters diff --git a/src/test/ui/traits/trait-object-vs-lifetime.stderr b/src/test/ui/traits/trait-object-vs-lifetime.stderr index d875e7d4845..c0b65a7aa5c 100644 --- a/src/test/ui/traits/trait-object-vs-lifetime.stderr +++ b/src/test/ui/traits/trait-object-vs-lifetime.stderr @@ -10,11 +10,11 @@ error[E0224]: at least one non-builtin trait is required for an object type LL | let _: S<'static, 'static +>; | ^^^^^^^^^ -error[E0107]: wrong number of lifetime parameters: expected 1, found 2 - --> $DIR/trait-object-vs-lifetime.rs:23:12 +error[E0107]: wrong number of lifetime arguments: expected 1, found 2 + --> $DIR/trait-object-vs-lifetime.rs:23:23 | LL | let _: S<'static, 'static>; - | ^^^^^^^^^^^^^^^^^^^ unexpected lifetime parameter + | ^^^^^^^ unexpected lifetime argument error[E0243]: wrong number of type arguments: expected 1, found 0 --> $DIR/trait-object-vs-lifetime.rs:23:12 diff --git a/src/test/ui/traits/trait-test-2.rs b/src/test/ui/traits/trait-test-2.rs index b08aab6da85..dac76fb57fd 100644 --- a/src/test/ui/traits/trait-test-2.rs +++ b/src/test/ui/traits/trait-test-2.rs @@ -15,8 +15,8 @@ impl bar for i32 { fn dup(&self) -> i32 { *self } fn blah<X>(&self) {} } impl bar for u32 { fn dup(&self) -> u32 { *self } fn blah<X>(&self) {} } fn main() { - 10.dup::<i32>(); //~ ERROR expected at most 0 type parameters, found 1 type parameter - 10.blah::<i32, i32>(); //~ ERROR expected at most 1 type parameter, found 2 type parameters + 10.dup::<i32>(); //~ ERROR wrong number of type arguments: expected 0, found 1 + 10.blah::<i32, i32>(); //~ ERROR wrong number of type arguments: expected 1, found 2 (box 10 as Box<bar>).dup(); //~^ ERROR E0038 //~| ERROR E0038 diff --git a/src/test/ui/traits/trait-test-2.stderr b/src/test/ui/traits/trait-test-2.stderr index 58e91447963..fb9cd701922 100644 --- a/src/test/ui/traits/trait-test-2.stderr +++ b/src/test/ui/traits/trait-test-2.stderr @@ -1,14 +1,14 @@ -error[E0087]: too many type parameters provided: expected at most 0 type parameters, found 1 type parameter +error[E0087]: wrong number of type arguments: expected 0, found 1 --> $DIR/trait-test-2.rs:18:14 | -LL | 10.dup::<i32>(); //~ ERROR expected at most 0 type parameters, found 1 type parameter - | ^^^ expected 0 type parameters +LL | 10.dup::<i32>(); //~ ERROR wrong number of type arguments: expected 0, found 1 + | ^^^ unexpected type argument -error[E0087]: too many type parameters provided: expected at most 1 type parameter, found 2 type parameters +error[E0087]: wrong number of type arguments: expected 1, found 2 --> $DIR/trait-test-2.rs:19:20 | -LL | 10.blah::<i32, i32>(); //~ ERROR expected at most 1 type parameter, found 2 type parameters - | ^^^ expected 1 type parameter +LL | 10.blah::<i32, i32>(); //~ ERROR wrong number of type arguments: expected 1, found 2 + | ^^^ unexpected type argument error[E0277]: the trait bound `dyn bar: bar` is not satisfied --> $DIR/trait-test-2.rs:20:26 diff --git a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs index 15fc3ecab97..9285b8ca6bc 100644 --- a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs +++ b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.rs @@ -18,12 +18,12 @@ struct MyStruct1<T: Copy<T>>; //~^ ERROR wrong number of type arguments: expected 0, found 1 [E0244] struct MyStruct2<'a, T: Copy<'a>>; -//~^ ERROR: wrong number of lifetime parameters: expected 0, found 1 +//~^ ERROR: wrong number of lifetime arguments: expected 0, found 1 fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} //~^ ERROR wrong number of type arguments: expected 0, found 1 [E0244] -//~| ERROR: wrong number of lifetime parameters: expected 0, found 1 +//~| ERROR: wrong number of lifetime arguments: expected 0, found 1 fn main() { } diff --git a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr index 221f05b9150..b6444181dd8 100644 --- a/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr +++ b/src/test/ui/typeck/typeck-builtin-bound-type-parameters.stderr @@ -1,38 +1,38 @@ error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/typeck-builtin-bound-type-parameters.rs:11:11 + --> $DIR/typeck-builtin-bound-type-parameters.rs:11:16 | LL | fn foo1<T:Copy<U>, U>(x: T) {} - | ^^^^^^^ expected no type arguments + | ^ unexpected type argument error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/typeck-builtin-bound-type-parameters.rs:14:14 + --> $DIR/typeck-builtin-bound-type-parameters.rs:14:19 | LL | trait Trait: Copy<Send> {} - | ^^^^^^^^^^ expected no type arguments + | ^^^^ unexpected type argument error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/typeck-builtin-bound-type-parameters.rs:17:21 + --> $DIR/typeck-builtin-bound-type-parameters.rs:17:26 | LL | struct MyStruct1<T: Copy<T>>; - | ^^^^^^^ expected no type arguments + | ^ unexpected type argument -error[E0107]: wrong number of lifetime parameters: expected 0, found 1 - --> $DIR/typeck-builtin-bound-type-parameters.rs:20:25 +error[E0107]: wrong number of lifetime arguments: expected 0, found 1 + --> $DIR/typeck-builtin-bound-type-parameters.rs:20:30 | LL | struct MyStruct2<'a, T: Copy<'a>>; - | ^^^^^^^^ unexpected lifetime parameter + | ^^ unexpected lifetime argument -error[E0107]: wrong number of lifetime parameters: expected 0, found 1 - --> $DIR/typeck-builtin-bound-type-parameters.rs:24:15 +error[E0107]: wrong number of lifetime arguments: expected 0, found 1 + --> $DIR/typeck-builtin-bound-type-parameters.rs:24:20 | LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} - | ^^^^^^^^^^^ unexpected lifetime parameter + | ^^ unexpected lifetime argument error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/typeck-builtin-bound-type-parameters.rs:24:15 + --> $DIR/typeck-builtin-bound-type-parameters.rs:24:24 | LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} - | ^^^^^^^^^^^ expected no type arguments + | ^ unexpected type argument error: aborting due to 6 previous errors diff --git a/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr b/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr index fe9566b3181..a49839b7310 100644 --- a/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr +++ b/src/test/ui/typeck/typeck_type_placeholder_lifetime_1.stderr @@ -1,8 +1,8 @@ error[E0244]: wrong number of type arguments: expected 1, found 2 - --> $DIR/typeck_type_placeholder_lifetime_1.rs:19:12 + --> $DIR/typeck_type_placeholder_lifetime_1.rs:19:19 | LL | let c: Foo<_, _> = Foo { r: &5 }; - | ^^^^^^^^^ expected 1 type argument + | ^ unexpected type argument error: aborting due to previous error diff --git a/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr b/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr index 64ec4245466..cafb6f507a0 100644 --- a/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr +++ b/src/test/ui/typeck/typeck_type_placeholder_lifetime_2.stderr @@ -1,8 +1,8 @@ error[E0244]: wrong number of type arguments: expected 1, found 2 - --> $DIR/typeck_type_placeholder_lifetime_2.rs:19:12 + --> $DIR/typeck_type_placeholder_lifetime_2.rs:19:19 | LL | let c: Foo<_, usize> = Foo { r: &5 }; - | ^^^^^^^^^^^^^ expected 1 type argument + | ^^^^^ unexpected type argument error: aborting due to previous error diff --git a/src/test/ui/ufcs/ufcs-qpath-missing-params.rs b/src/test/ui/ufcs/ufcs-qpath-missing-params.rs index 5c108e05216..294a0fa0340 100644 --- a/src/test/ui/ufcs/ufcs-qpath-missing-params.rs +++ b/src/test/ui/ufcs/ufcs-qpath-missing-params.rs @@ -22,5 +22,5 @@ impl<'a> IntoCow<'a, str> for String { fn main() { <String as IntoCow>::into_cow("foo".to_string()); - //~^ ERROR too few type parameters provided: expected 1 type parameter + //~^ ERROR wrong number of type arguments: expected 1, found 0 } diff --git a/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr b/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr index 6c752dba6b4..2653b7bf4ac 100644 --- a/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr +++ b/src/test/ui/ufcs/ufcs-qpath-missing-params.stderr @@ -1,8 +1,8 @@ -error[E0089]: too few type parameters provided: expected 1 type parameter, found 0 type parameters +error[E0089]: wrong number of type arguments: expected 1, found 0 --> $DIR/ufcs-qpath-missing-params.rs:24:5 | LL | <String as IntoCow>::into_cow("foo".to_string()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 type parameter + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 type argument error: aborting due to previous error diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.rs b/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.rs index 18a1185d695..331ad620c27 100644 --- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.rs +++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.rs @@ -38,7 +38,7 @@ fn test<'a,'b>() { } fn test2(x: &Foo<(isize,),Output=()>, y: &Foo(isize)) { -//~^ ERROR wrong number of lifetime parameters: expected 1, found 0 +//~^ ERROR wrong number of lifetime arguments: expected 1, found 0 // Here, the omitted lifetimes are expanded to distinct things. same_type(x, y) } diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr index 663034ba143..2245c5e6648 100644 --- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-region.stderr @@ -1,8 +1,8 @@ -error[E0107]: wrong number of lifetime parameters: expected 1, found 0 +error[E0107]: wrong number of lifetime arguments: expected 1, found 0 --> $DIR/unboxed-closure-sugar-region.rs:40:43 | LL | fn test2(x: &Foo<(isize,),Output=()>, y: &Foo(isize)) { - | ^^^^^^^^^^ expected 1 lifetime parameter + | ^^^^^^^^^^ expected 1 lifetime argument error: aborting due to previous error diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr index 457bea046c7..89587c47cf6 100644 --- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr @@ -1,8 +1,8 @@ error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:15:11 + --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:15:15 | LL | fn foo(_: Zero()) - | ^^^^^^ expected no type arguments + | ^^ unexpected type argument error[E0220]: associated type `Output` not found for `Zero` --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:15:15 diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr index 82ba4e66393..5d8c86f5a58 100644 --- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr @@ -1,8 +1,8 @@ error[E0244]: wrong number of type arguments: expected 0, found 1 - --> $DIR/unboxed-closure-sugar-wrong-trait.rs:15:8 + --> $DIR/unboxed-closure-sugar-wrong-trait.rs:15:13 | LL | fn f<F:Trait(isize) -> isize>(x: F) {} - | ^^^^^^^^^^^^^^^^^^^^^ expected no type arguments + | ^^^^^^^^^^^^^^^^ unexpected type argument error[E0220]: associated type `Output` not found for `Trait` --> $DIR/unboxed-closure-sugar-wrong-trait.rs:15:24 |
