Files
rust/tests/ui/derives/clone-copy/copy-drop-mutually-exclusive.stderr
T
2026-04-22 20:22:40 +00:00

32 lines
1.0 KiB
Plaintext

error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
--> $DIR/copy-drop-mutually-exclusive.rs:4:8
|
LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Foo;
| ^^^ `Copy` not allowed on types with destructors
|
note: destructor declared here
--> $DIR/copy-drop-mutually-exclusive.rs:7:5
|
LL | fn drop(&mut self) {}
| ^^^^^^^^^^^^^^^^^^
error[E0184]: the trait `Copy` cannot be implemented for this type; the type has a destructor
--> $DIR/copy-drop-mutually-exclusive.rs:11:8
|
LL | #[derive(Copy, Clone)]
| ---- in this derive macro expansion
LL | struct Bar<T>(::std::marker::PhantomData<T>);
| ^^^ `Copy` not allowed on types with destructors
|
note: destructor declared here
--> $DIR/copy-drop-mutually-exclusive.rs:14:5
|
LL | fn drop(&mut self) {}
| ^^^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0184`.