]> git.lizzy.rs Git - rust.git/blob - src/test/ui/exclusive-drop-and-copy.rs
Merge commit 'f2cdd4a78d89c009342197cf5844a21f8aa813df' into sync_cg_clif-2022-04-22
[rust.git] / src / test / ui / exclusive-drop-and-copy.rs
1 // issue #20126
2
3 #[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
4 struct Foo;
5
6 impl Drop for Foo {
7     fn drop(&mut self) {}
8 }
9
10 #[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
11 struct Bar<T>(::std::marker::PhantomData<T>);
12
13 impl<T> Drop for Bar<T> {
14     fn drop(&mut self) {}
15 }
16
17 fn main() {}