-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc_trans: apply the debug location for the MIR Assert panic call. #35141
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like this is a fairly easy stuff to overlook. I skimmed the context and haven’t found any more obvious instances of such mistake, but I feel like it is considerably easy to make similar mistake at any point in the future.
Perhaps we should consider making a wrapper of some sort for fcx.new_block
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When old trans is gone, we can have a simpler and less error-prone interface, i.e. a Block
that always knows its debug position.
r=me, but I have a feeling that I will see a similar PR at some time in the future again. |
@bors r=nagisa rollup |
📌 Commit d1f341d has been approved by |
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! ```
Helps
libcore
build with MIR trans and debuginfo; libcore has the body ofpanic
, which resulted in: