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 d280f76 commit 90542eeCopy full SHA for 90542ee
clippy_lints/src/let_arr_const.rs
@@ -48,6 +48,10 @@ impl<'tcx> LateLintPass<'tcx> for LetArrConst {
48
&& let Some(init) = local.init
49
&& !init.span.from_expansion()
50
{
51
+ // LLVM optimizes the load of 16 byte as a single `mov`.
52
+ // Bigger values make more `mov` instructions generated.
53
+ // While changing code as this lint suggests, it becomes
54
+ // a single load (`lea`) of an address in `.rodata`.
55
const STACK_THRESHOLD: u64 = 16;
56
// lint only `if size_of(init) > STACK_THRESHOLD`
57
let ty = cx.typeck_results().expr_ty(init);
0 commit comments