summaryrefslogtreecommitdiffstats
path: root/tests/ui/derives/derive-on-trait-item-or-impl-item.rs
blob: 7e579ec22dd42762b36768d7a2aa463a3d9c25e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
trait Foo {
    #[derive(Clone)]
    //~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
    type Bar;
}

struct Bar;

impl Bar {
    #[derive(Clone)]
    //~^ ERROR `derive` may only be applied to `struct`s, `enum`s and `union`s
    fn bar(&self) {}
}

fn main() {}