mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-26 13:01:27 +03:00
18 lines
404 B
Rust
18 lines
404 B
Rust
//! Regression test for issue #20126: Copy and Drop traits are mutually exclusive
|
|
|
|
#[derive(Copy, Clone)]
|
|
struct Foo; //~ ERROR the trait `Copy` cannot be implemented
|
|
|
|
impl Drop for Foo {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
#[derive(Copy, Clone)]
|
|
struct Bar<T>(::std::marker::PhantomData<T>); //~ ERROR the trait `Copy` cannot be implemented
|
|
|
|
impl<T> Drop for Bar<T> {
|
|
fn drop(&mut self) {}
|
|
}
|
|
|
|
fn main() {}
|