rust/tests/ui/suggestions/suggest-swapping-self-ty-and-trait-edition-2021.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
624 B
Rust
Raw Permalink Normal View History

//@ edition:2021
pub trait Trait<'a, T> {}
2022-06-09 03:52:10 -05:00
pub struct Struct<T>;
//~^ ERROR `T` is never used
2022-06-09 03:52:10 -05:00
pub enum Enum<T> {}
//~^ ERROR `T` is never used
2022-06-09 03:52:10 -05:00
pub union Union<T> {
//~^ ERROR `T` is never used
2022-06-09 03:52:10 -05:00
f1: usize,
}
impl<'a, T> Struct<T> for Trait<'a, T> {}
//~^ ERROR expected trait, found struct `Struct`
//~| ERROR expected a type, found a trait
2022-06-09 03:52:10 -05:00
impl<'a, T> Enum<T> for Trait<'a, T> {}
//~^ ERROR expected trait, found enum `Enum`
//~| ERROR expected a type, found a trait
2022-06-09 03:52:10 -05:00
impl<'a, T> Union<T> for Trait<'a, T> {}
//~^ ERROR expected trait, found union `Union`
//~| ERROR expected a type, found a trait
2022-06-09 03:52:10 -05:00
fn main() {}