mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-25 12:33:30 +00:00
61 lines
1.5 KiB
Text
61 lines
1.5 KiB
Text
error: exported enums should not be exhaustive
|
|
--> tests/ui/exhaustive_items.rs:9:5
|
|
|
|
|
LL | / pub enum Exhaustive {
|
|
LL | | Foo,
|
|
LL | | Bar,
|
|
LL | | Baz,
|
|
LL | | Quux(String),
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
note: the lint level is defined here
|
|
--> tests/ui/exhaustive_items.rs:1:9
|
|
|
|
|
LL | #![deny(clippy::exhaustive_enums, clippy::exhaustive_structs)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: try adding #[non_exhaustive]
|
|
|
|
|
LL ~ #[non_exhaustive]
|
|
LL ~ pub enum Exhaustive {
|
|
|
|
|
|
|
error: exported enums should not be exhaustive
|
|
--> tests/ui/exhaustive_items.rs:18:5
|
|
|
|
|
LL | / pub enum ExhaustiveWithAttrs {
|
|
LL | | Foo,
|
|
LL | | Bar,
|
|
LL | | Baz,
|
|
LL | | Quux(String),
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
help: try adding #[non_exhaustive]
|
|
|
|
|
LL ~ #[non_exhaustive]
|
|
LL ~ pub enum ExhaustiveWithAttrs {
|
|
|
|
|
|
|
error: exported structs should not be exhaustive
|
|
--> tests/ui/exhaustive_items.rs:53:5
|
|
|
|
|
LL | / pub struct Exhaustive {
|
|
LL | | pub foo: u8,
|
|
LL | | pub bar: String,
|
|
LL | | }
|
|
| |_____^
|
|
|
|
|
note: the lint level is defined here
|
|
--> tests/ui/exhaustive_items.rs:1:35
|
|
|
|
|
LL | #![deny(clippy::exhaustive_enums, clippy::exhaustive_structs)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
help: try adding #[non_exhaustive]
|
|
|
|
|
LL ~ #[non_exhaustive]
|
|
LL ~ pub struct Exhaustive {
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|