Skip to content

Commit caf5a67

Browse files
committed
Fixed issue #15192
Fixed issue #15192 by adding checks for no_std whild giving out Box recommendation
1 parent b8f5a9d commit caf5a67

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

clippy_lints/src/large_enum_variant.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ use rustc_middle::ty::{self, Ty};
1010
use rustc_session::impl_lint_pass;
1111
use rustc_span::Span;
1212

13+
14+
15+
1316
declare_clippy_lint! {
1417
/// ### What it does
1518
/// Checks for large size differences between variants on
@@ -150,7 +153,10 @@ impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
150153
return;
151154
}
152155
}
153-
diag.span_help(def.variants[variants_size[0].ind].span, help_text);
156+
if !is_no_std_crate(cx) {
157+
diag.span_help(def.variants[variants_size[0].ind].span, help_text);
158+
}
159+
154160
},
155161
);
156162
}

0 commit comments

Comments
 (0)