Skip to content

Commit 8d81dee

Browse files
committed
Dont generate ICE
1 parent aa565c7 commit 8d81dee

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

compiler/rustc_codegen_ssa/src/mir/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,14 +232,9 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
232232
if layout.size.bytes() >= MIN_DANGEROUS_SIZE {
233233
let size_str = || {
234234
let (size_quantity, size_unit) = human_readable_bytes(layout.size.bytes());
235-
format!("{:.2} {}", size_quantity, size_unit)
235+
format!("Dangerous stack allocation of size: {:.2} {} exceeds limits on most architectures", size_quantity, size_unit)
236236
};
237-
span_bug!(
238-
decl.source_info.span,
239-
"Dangerous stack allocation, size: {:?} of local: {:?} exceeds typical limits on most architectures",
240-
size_str(),
241-
local
242-
);
237+
cx.tcx().dcx().fatal(size_str());
243238
}
244239

245240
if local == mir::RETURN_PLACE && fx.fn_abi.ret.is_indirect() {
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
WARN rustc_codegen_ssa::mir Dangerous stack allocation, size: "2.00 GiB" of local: _1 exceeds typical limits on most architectures
1+
error: Dangerous stack allocation of size: 2.00 GiB exceeds limits on most architectures
2+
3+
error: aborting due to 1 previous error
4+

0 commit comments

Comments
 (0)