about summary refs log tree commit diff
path: root/tests/ui/derives/copy-drop-mutually-exclusive.rs
blob: 5147605910d7b6bc89c17b556faf4a3f856d1e9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Regression test for issue #20126: Copy and Drop traits are mutually exclusive

#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
struct Foo;

impl Drop for Foo {
    fn drop(&mut self) {}
}

#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
struct Bar<T>(::std::marker::PhantomData<T>);

impl<T> Drop for Bar<T> {
    fn drop(&mut self) {}
}

fn main() {}