rust/tests/ui/opt-in-copy.rs

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

23 lines
398 B
Rust
Raw Normal View History

struct CantCopyThis;
struct IWantToCopyThis {
but_i_cant: CantCopyThis,
}
impl Copy for IWantToCopyThis {}
2023-03-08 07:55:51 +08:00
//~^ ERROR the trait `Copy` cannot be implemented for this type
enum CantCopyThisEither {
A,
B,
}
enum IWantToCopyThisToo {
ButICant(CantCopyThisEither),
}
impl Copy for IWantToCopyThisToo {}
2023-03-08 07:55:51 +08:00
//~^ ERROR the trait `Copy` cannot be implemented for this type
fn main() {}