Skip to content

Commit dc63b3a

Browse files
authored
Rollup merge of #35141 - eddyb:assert-mir-debug, r=nagisa
rustc_trans: apply the debug location for the MIR Assert panic call. Helps `libcore` build with MIR trans and debuginfo; libcore has the body of `panic`, which resulted in: ``` inlinable function call in a function with debug info must have a !dbg location call void @_ZN4core9panicking5panic17h585bd70cda921012E({ %str_slice, %str_slice, i32 }* @panic_loc12745) LLVM ERROR: Broken function found, compilation aborted! ```
2 parents a790fbc + d1f341d commit dc63b3a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustc_trans/mir/block.rs

+1
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
284284

285285
// After this point, bcx is the block for the call to panic.
286286
bcx = panic_block.build();
287+
debug_loc.apply_to_bcx(&bcx);
287288

288289
// Get the location information.
289290
let loc = bcx.sess().codemap().lookup_char_pos(span.lo);

0 commit comments

Comments
 (0)