Update error message for E0243 and E0244
This commit is contained in:
parent
ddf92ffae4
commit
02f3609a01
11 changed files with 57 additions and 25 deletions
|
|
@ -9,7 +9,9 @@
|
|||
// except according to those terms.
|
||||
|
||||
struct Foo<T> { x: T }
|
||||
struct Bar { x: Foo } //~ ERROR E0243
|
||||
struct Bar { x: Foo }
|
||||
//~^ ERROR E0243
|
||||
//~| NOTE expected 1 type arguments, found 0
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@
|
|||
// except according to those terms.
|
||||
|
||||
struct Foo { x: bool }
|
||||
struct Bar<S, T> { x: Foo<S, T> } //~ ERROR E0244
|
||||
struct Bar<S, T> { x: Foo<S, T> }
|
||||
//~^ ERROR E0244
|
||||
//~| NOTE expected no type arguments, found 2
|
||||
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,5 +16,7 @@ struct Vec<T, A = Heap>(
|
|||
marker::PhantomData<(T,A)>);
|
||||
|
||||
fn main() {
|
||||
let _: Vec; //~ ERROR wrong number of type arguments: expected at least 1, found 0
|
||||
let _: Vec;
|
||||
//~^ ERROR E0243
|
||||
//~| NOTE expected at least 1 type arguments, found 0
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,6 @@ struct Vec<T, A = Heap>(
|
|||
|
||||
fn main() {
|
||||
let _: Vec<isize, Heap, bool>;
|
||||
//~^ ERROR wrong number of type arguments: expected at most 2, found 3
|
||||
//~^ ERROR E0244
|
||||
//~| NOTE expected at most 2 type arguments, found 3
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn fn1(0: Box) {} //~ ERROR: wrong number of type arguments: expected 1, found 0
|
||||
fn fn1(0: Box) {}
|
||||
//~^ ERROR E0243
|
||||
//~| NOTE expected 1 type arguments, found 0
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@ fn main()
|
|||
vfnfer.push(box h);
|
||||
println!("{:?}",(vfnfer[0] as Fn)(3));
|
||||
//~^ ERROR the precise format of `Fn`-family traits'
|
||||
//~| ERROR wrong number of type arguments: expected 1, found 0
|
||||
//~| ERROR E0243
|
||||
//~| NOTE expected 1 type arguments, found 0
|
||||
//~| ERROR the value of the associated type `Output` (from the trait `std::ops::FnOnce`)
|
||||
//~| NOTE in this expansion of println!
|
||||
//~| NOTE in this expansion of println!
|
||||
//~| NOTE in this expansion of println!
|
||||
//~| NOTE in this expansion of println!
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,20 +9,27 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn foo1<T:Copy<U>, U>(x: T) {}
|
||||
//~^ ERROR: wrong number of type arguments: expected 0, found 1
|
||||
//~^ ERROR E0244
|
||||
//~| NOTE expected no type arguments, found 1
|
||||
|
||||
trait Trait: Copy<Send> {}
|
||||
//~^ ERROR: wrong number of type arguments: expected 0, found 1
|
||||
//~^ ERROR E0244
|
||||
//~| NOTE expected no type arguments, found 1
|
||||
|
||||
struct MyStruct1<T: Copy<T>>;
|
||||
//~^ ERROR wrong number of type arguments: expected 0, found 1
|
||||
//~^ ERROR E0244
|
||||
//~| NOTE expected no type arguments, found 1
|
||||
|
||||
struct MyStruct2<'a, T: Copy<'a>>;
|
||||
//~^ ERROR: wrong number of lifetime parameters: expected 0, found 1
|
||||
//~| NOTE unexpected lifetime parameter
|
||||
|
||||
|
||||
fn foo2<'a, T:Copy<'a, U>, U>(x: T) {}
|
||||
//~^ ERROR: wrong number of type arguments: expected 0, found 1
|
||||
//~^^ ERROR: wrong number of lifetime parameters: expected 0, found 1
|
||||
//~^ ERROR E0244
|
||||
//~| NOTE expected no type arguments, found 1
|
||||
//~| ERROR: wrong number of lifetime parameters: expected 0, found 1
|
||||
//~| NOTE unexpected lifetime parameter
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,6 @@ struct Foo<'a, T:'a> {
|
|||
|
||||
pub fn main() {
|
||||
let c: Foo<_, _> = Foo { r: &5 };
|
||||
//~^ ERROR wrong number of type arguments: expected 1, found 2
|
||||
//~^ ERROR E0244
|
||||
//~| NOTE expected 1 type arguments, found 2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,5 +17,6 @@ struct Foo<'a, T:'a> {
|
|||
|
||||
pub fn main() {
|
||||
let c: Foo<_, usize> = Foo { r: &5 };
|
||||
//~^ ERROR wrong number of type arguments: expected 1, found 2
|
||||
//~^ ERROR E0244
|
||||
//~| NOTE expected 1 type arguments, found 2
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,8 @@
|
|||
trait Trait {}
|
||||
|
||||
fn f<F:Trait(isize) -> isize>(x: F) {}
|
||||
//~^ ERROR wrong number of type arguments: expected 0, found 1
|
||||
//~^ ERROR E0244
|
||||
//~| NOTE expected no type arguments, found 1
|
||||
//~| ERROR associated type `Output` not found
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue