Skip to content

Commit

Permalink
Rollup merge of rust-lang#35141 - eddyb:assert-mir-debug, r=nagisa
Browse files Browse the repository at this point in the history
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!
```
  • Loading branch information
sanxiyn authored Aug 1, 2016
2 parents a790fbc + d1f341d commit dc63b3a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_trans/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {

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

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

0 comments on commit dc63b3a

Please sign in to comment.