Skip to content

Commit b77028a

Browse files
committed
help text condition removed
1 parent 2614a31 commit b77028a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

clippy_lints/src/large_enum_variant.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,7 @@ impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
150150
return;
151151
}
152152
}
153-
if !is_no_std_crate(cx) {
154-
diag.span_help(def.variants[variants_size[0].ind].span, help_text);
155-
}
153+
diag.span_help(def.variants[variants_size[0].ind].span, help_text);
156154
},
157155
);
158156
}

tests/ui/large_enum_variant_no_std.stderr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ LL | | Large([u8; 1024]),
1010
LL | | }
1111
| |_^ the entire enum is at least 1025 bytes
1212
|
13+
help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum
14+
--> tests/ui/large_enum_variant_no_std.rs:7:5
15+
|
16+
LL | Large([u8; 1024]),
17+
| ^^^^^^^^^^^^^^^^^
1318
= note: `-D clippy::large-enum-variant` implied by `-D warnings`
1419
= help: to override `-D warnings` add `#[allow(clippy::large_enum_variant)]`
1520

0 commit comments

Comments
 (0)