We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61a3ee7 commit 469281cCopy full SHA for 469281c
clippy_lints/src/empty_enum.rs
@@ -44,7 +44,9 @@ impl<'tcx> LateLintPass<'tcx> for EmptyEnum {
44
if let ItemKind::Enum(..) = item.kind {
45
let ty = cx.tcx.type_of(did);
46
let adt = ty.ty_adt_def().expect("already checked whether this is an enum");
47
- if adt.variants.is_empty() {
+
48
+ // Only suggest the never type if the feature is enabled
49
+ if adt.variants.is_empty() && cx.tcx.features().never_type {
50
span_lint_and_help(
51
cx,
52
EMPTY_ENUM,
0 commit comments