mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-04 20:54:13 +00:00
22 lines
556 B
Rust
22 lines
556 B
Rust
pub trait Trait<'a, T> {}
|
|
|
|
pub struct Struct<T>;
|
|
pub enum Enum<T> {}
|
|
|
|
pub union Union<T> {
|
|
f1: usize,
|
|
}
|
|
|
|
impl<'a, T> Struct<T> for Trait<'a, T> {}
|
|
//~^ ERROR expected trait, found struct `Struct`
|
|
//~| WARNING trait objects without an explicit `dyn` are deprecated
|
|
//~| WARNING this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
|
|
|
|
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`
|
|
|
|
fn main() {}
|