Auto merge of #51880 - varkor:generics-hir-generalisation-followup, r=eddyb
The Great Generics Generalisation: HIR Followup Addresses the final comments in #48149. r? @eddyb, but there are a few things I have yet to clean up. Making the PR now to more easily see when things break. cc @yodaldevoid
This commit is contained in:
commit
1558ae7cfd
57 changed files with 972 additions and 800 deletions
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
21
src/test/ui/generic/generic-arg-mismatch-recover.rs
Normal file
21
src/test/ui/generic/generic-arg-mismatch-recover.rs
Normal file
|
|
@ -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
|
||||
}
|
||||
31
src/test/ui/generic/generic-arg-mismatch-recover.stderr
Normal file
31
src/test/ui/generic/generic-arg-mismatch-recover.stderr
Normal file
|
|
@ -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`.
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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`.
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue