Ryan Mehri | a8e7e79 | 2023-10-16 18:05:04 | [diff] [blame] | 1 | // Test for issue #116766. |
2 | // Ensure that we don't suggest impl'ing `Copy` for a type if it or at least one | ||||
3 | // of it's variants are marked as `non_exhaustive`. | ||||
4 | |||||
许杰友 Jieyou Xu (Joe) | ec2cc76 | 2024-02-16 20:02:50 | [diff] [blame] | 5 | //@ check-pass |
Ryan Mehri | a8e7e79 | 2023-10-16 18:05:04 | [diff] [blame] | 6 | |
7 | #![deny(missing_copy_implementations)] | ||||
8 | |||||
9 | #[non_exhaustive] | ||||
10 | pub enum MyEnum { | ||||
11 | A, | ||||
12 | } | ||||
13 | |||||
14 | #[non_exhaustive] | ||||
15 | pub struct MyStruct { | ||||
16 | foo: usize, | ||||
17 | } | ||||
18 | |||||
19 | pub enum MyEnum2 { | ||||
20 | #[non_exhaustive] | ||||
21 | A, | ||||
22 | B, | ||||
23 | } | ||||
24 | |||||
25 | fn main() {} |