Skip to content

Commit 3113d22

Browse files
committed
tidy
1 parent 263bbe3 commit 3113d22

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

compiler/rustc_codegen_ssa/src/mir/mod.rs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ use rustc_middle::mir::{UnwindTerminateReason, traversal};
88
use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv, TyAndLayout};
99
use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeFoldable, TypeVisitableExt};
1010
use rustc_middle::{bug, mir, span_bug};
11-
use rustc_target::callconv::{FnAbi, PassMode};
1211
use rustc_session::lint;
12+
use rustc_target::callconv::{FnAbi, PassMode};
1313
use tracing::{debug, instrument};
1414

15-
use crate::traits::*;
1615
use crate::base;
16+
use crate::traits::*;
1717

1818
mod analyze;
1919
mod block;
@@ -251,16 +251,19 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
251251

252252
if layout.size.bytes() >= MIN_DANGEROUS_SIZE {
253253
let (size_quantity, size_unit) = human_readable_bytes(layout.size.bytes());
254-
cx.tcx().node_span_lint(
255-
lint::builtin::DANGEROUS_STACK_ALLOCATION,
256-
CRATE_HIR_ID,
257-
decl.source_info.span,
258-
|lint| {
259-
lint.primary_message(format!("allocation of size: {:.2} {} exceeds most system architecture limits", size_quantity, size_unit));
260-
},
261-
);
254+
cx.tcx().node_span_lint(
255+
lint::builtin::DANGEROUS_STACK_ALLOCATION,
256+
CRATE_HIR_ID,
257+
decl.source_info.span,
258+
|lint| {
259+
lint.primary_message(format!(
260+
"allocation of size: {:.2} {} exceeds most system architecture limits",
261+
size_quantity, size_unit
262+
));
263+
},
264+
);
262265
}
263-
266+
264267
if local == mir::RETURN_PLACE {
265268
match fx.fn_abi.ret.mode {
266269
PassMode::Indirect { .. } => {

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ declare_lint! {
747747
/// ### Explanation
748748
///
749749
/// Large arras may cause stack overflow due to the limited size of the
750-
/// stack on most platforms.
750+
/// stack on most platforms.
751751
pub DANGEROUS_STACK_ALLOCATION,
752752
Warn,
753753
"Detects dangerous stack allocations at the limit of most architectures"

0 commit comments

Comments
 (0)