diff options
Diffstat (limited to 'tests/ui/opt-in-copy.rs')
-rw-r--r-- | tests/ui/opt-in-copy.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/opt-in-copy.rs b/tests/ui/opt-in-copy.rs new file mode 100644 index 000000000..0b48418e4 --- /dev/null +++ b/tests/ui/opt-in-copy.rs @@ -0,0 +1,22 @@ +struct CantCopyThis; + +struct IWantToCopyThis { + but_i_cant: CantCopyThis, +} + +impl Copy for IWantToCopyThis {} +//~^ ERROR the trait `Copy` may not be implemented for this type + +enum CantCopyThisEither { + A, + B, +} + +enum IWantToCopyThisToo { + ButICant(CantCopyThisEither), +} + +impl Copy for IWantToCopyThisToo {} +//~^ ERROR the trait `Copy` may not be implemented for this type + +fn main() {} |