blob: 16f448674b29af24bf58bd945655dbc697cfb658 [file] [log] [blame]
Ryan Mehria8e7e792023-10-16 18:05:041// 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)ec2cc762024-02-16 20:02:505//@ check-pass
Ryan Mehria8e7e792023-10-16 18:05:046
7#![deny(missing_copy_implementations)]
8
9#[non_exhaustive]
10pub enum MyEnum {
11 A,
12}
13
14#[non_exhaustive]
15pub struct MyStruct {
16 foo: usize,
17}
18
19pub enum MyEnum2 {
20 #[non_exhaustive]
21 A,
22 B,
23}
24
25fn main() {}