2022-06-06 17:33:23 +00:00
|
|
|
// edition:2021
|
|
|
|
|
|
|
|
pub trait Trait<'a, T> {}
|
|
|
|
|
2022-06-09 08:52:10 +00:00
|
|
|
pub struct Struct<T>;
|
|
|
|
pub enum Enum<T> {}
|
|
|
|
|
|
|
|
pub union Union<T> {
|
|
|
|
f1: usize,
|
|
|
|
}
|
2022-06-06 17:33:23 +00:00
|
|
|
|
|
|
|
impl<'a, T> Struct<T> for Trait<'a, T> {}
|
|
|
|
//~^ ERROR expected trait, found struct `Struct`
|
|
|
|
//~| ERROR trait objects must include the `dyn` keyword
|
|
|
|
|
2022-06-09 08:52:10 +00:00
|
|
|
impl<'a, T> Enum<T> for Trait<'a, T> {}
|
|
|
|
//~^ ERROR expected trait, found enum `Enum`
|
|
|
|
|
|
|
|
impl<'a, T> Union<T> for Trait<'a, T> {}
|
|
|
|
//~^ ERROR expected trait, found union `Union`
|
|
|
|
|
2022-06-06 17:33:23 +00:00
|
|
|
fn main() {}
|