Fix #[expect] for clippy::manual_non_exhaustive

This commit is contained in:
xFrednet 2022-06-25 14:16:33 +02:00
parent 525f5ee7ac
commit 6427ba4855
No known key found for this signature in database
GPG key ID: F5C59D0E669E5302
3 changed files with 18 additions and 8 deletions

View file

@ -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() {}

View file

@ -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,
| ^^