Skip to content

Commit c268ba6

Browse files
committed
Dont generate ICE
1 parent 896b6ad commit c268ba6

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

compiler/rustc_codegen_ssa/src/mir/mod.rs

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

244239
if local == mir::RETURN_PLACE && fx.fn_abi.ret.is_indirect() {
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)