mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
34 lines
1.2 KiB
Rust
34 lines
1.2 KiB
Rust
trait Foo<T> {}
|
|
|
|
impl Foo<T: Default> for String {}
|
|
//~^ ERROR associated item constraints are not allowed here
|
|
//~| HELP declare the type parameter right after the `impl` keyword
|
|
|
|
impl Foo<T: 'a + Default> for u8 {}
|
|
//~^ ERROR associated item constraints are not allowed here
|
|
//~| HELP declare the type parameter right after the `impl` keyword
|
|
//~| ERROR use of undeclared lifetime name `'a`
|
|
//~| HELP consider introducing lifetime `'a` here
|
|
|
|
impl<T> Foo<T: Default> for u16 {}
|
|
//~^ ERROR associated item constraints are not allowed here
|
|
//~| HELP declare the type parameter right after the `impl` keyword
|
|
|
|
impl<'a> Foo<T: 'a + Default> for u32 {}
|
|
//~^ ERROR associated item constraints are not allowed here
|
|
//~| HELP declare the type parameter right after the `impl` keyword
|
|
|
|
trait Bar<T, K> {}
|
|
|
|
impl Bar<T: Default, K: Default> for String {}
|
|
//~^ ERROR associated item constraints are not allowed here
|
|
//~| HELP declare the type parameter right after the `impl` keyword
|
|
|
|
impl<T> Bar<T, K: Default> for u8 {}
|
|
//~^ ERROR trait takes 2 generic arguments but 1 generic argument was supplied
|
|
//~| HELP add missing generic argument
|
|
//~| ERROR associated item constraints are not allowed here
|
|
//~| HELP declare the type parameter right after the `impl` keyword
|
|
|
|
fn main() {}
|