Fix #[expect] for clippy::manual_non_exhaustive
This commit is contained in:
parent
525f5ee7ac
commit
6427ba4855
3 changed files with 18 additions and 8 deletions
|
|
@ -1,3 +1,4 @@
|
|||
#![feature(lint_reasons)]
|
||||
#![warn(clippy::manual_non_exhaustive)]
|
||||
#![allow(unused)]
|
||||
|
||||
|
|
@ -75,4 +76,12 @@ fn foo(x: &mut UsedHidden) {
|
|||
}
|
||||
}
|
||||
|
||||
#[expect(clippy::manual_non_exhaustive)]
|
||||
enum ExpectLint {
|
||||
A,
|
||||
B,
|
||||
#[doc(hidden)]
|
||||
_C,
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
error: this seems like a manual implementation of the non-exhaustive pattern
|
||||
--> $DIR/manual_non_exhaustive_enum.rs:4:1
|
||||
--> $DIR/manual_non_exhaustive_enum.rs:5:1
|
||||
|
|
||||
LL | enum E {
|
||||
| ^-----
|
||||
|
|
@ -15,13 +15,13 @@ LL | | }
|
|||
|
|
||||
= note: `-D clippy::manual-non-exhaustive` implied by `-D warnings`
|
||||
help: remove this variant
|
||||
--> $DIR/manual_non_exhaustive_enum.rs:8:5
|
||||
--> $DIR/manual_non_exhaustive_enum.rs:9:5
|
||||
|
|
||||
LL | _C,
|
||||
| ^^
|
||||
|
||||
error: this seems like a manual implementation of the non-exhaustive pattern
|
||||
--> $DIR/manual_non_exhaustive_enum.rs:13:1
|
||||
--> $DIR/manual_non_exhaustive_enum.rs:14:1
|
||||
|
|
||||
LL | / enum Ep {
|
||||
LL | | A,
|
||||
|
|
@ -32,7 +32,7 @@ LL | | }
|
|||
| |_^
|
||||
|
|
||||
help: remove this variant
|
||||
--> $DIR/manual_non_exhaustive_enum.rs:17:5
|
||||
--> $DIR/manual_non_exhaustive_enum.rs:18:5
|
||||
|
|
||||
LL | _C,
|
||||
| ^^
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue