Files
rust/tests/ui/derives/copy-drop-mutually-exclusive.rs

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

18 lines
404 B
Rust
Raw Normal View History

2025-06-09 01:39:32 +05:00
//! Regression test for issue #20126: Copy and Drop traits are mutually exclusive
2023-03-07 23:55:51 +00:00
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` cannot be implemented
struct Foo;
impl Drop for Foo {
fn drop(&mut self) {}
}
2023-03-07 23:55:51 +00:00
#[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() {}