-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Give a message with a span on MIR validation error #144190
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
Give a message with a span on MIR validation error #144190
Conversation
The Miri subtree was changed cc @rust-lang/miri Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
@@ -1,11 +1,20 @@ | |||
error: internal compiler error: compiler/rustc_mir_transform/src/validate.rs:LL:CC: broken MIR in Item(DefId) (after phase change to runtime-optimized) at bb0[1]: | |||
place (*(_2.0: *mut i32)) has deref as a later projection (it is only permitted as the first projection) |
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.
Odd that there are so many leading spaces now... 🤷
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 think that's because a \n
in a bug message gets padded out to align vertically.
); | ||
if self.tcx.dcx().has_errors().is_none() { | ||
span_bug!( | ||
self.body.span, |
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.
You could use the location
to get a better span -- might be worth it?
Specifically, body.source_info(location).span
.
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.
That's so much better, thank you. I wish I had it when I was looking through 80-line test functions :P
12f12de
to
15fe203
Compare
Thanks! Nice little papercut fixed. r? @RalfJung |
15fe203
to
14d097f
Compare
Yup, 100%, just forgot it's ignore-windows so my run didn't notice. |
Ok, CI's happy other than the spellcheck that's failing everything. @bors r=RalfJung (WARNING for rollups: will conflict with 143833) |
Now it needs to be re-borsed, no?
@bors r+
|
💡 This pull request was already approved, no need to approve it again.
|
Apparently not :) |
Looks like doing that fixed the labels, at least :) |
…idation, r=RalfJung Give a message with a span on MIR validation error It was handy to get a source+line link for rust-lang#143833, even if it's just to the function and not necessarily to the statement. r? mir
Rollup of 9 pull requests Successful merges: - #143282 (Add `uX::strict_sub_signed`) - #143423 (address clippy formatting nits) - #143720 (Allow `Rvalue::Repeat` to return true in `rvalue_creates_operand` too) - #144011 (bootstrap: Don't trigger an unnecessary LLVM build from check builds) - #144112 (bootstrap: Ignore `rust.debuginfo-level-tests` for codegen tests) - #144125 (Add new `ignore-backends` and `needs-backends` tests annotations) - #144143 (Fix `-Ctarget-feature`s getting ignored after `crt-static`) - #144150 (tests: assembly: cstring-merging: Disable GlobalMerge pass) - #144190 (Give a message with a span on MIR validation error) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143282 (Add `uX::strict_sub_signed`) - rust-lang/rust#143423 (address clippy formatting nits) - rust-lang/rust#143720 (Allow `Rvalue::Repeat` to return true in `rvalue_creates_operand` too) - rust-lang/rust#144011 (bootstrap: Don't trigger an unnecessary LLVM build from check builds) - rust-lang/rust#144112 (bootstrap: Ignore `rust.debuginfo-level-tests` for codegen tests) - rust-lang/rust#144125 (Add new `ignore-backends` and `needs-backends` tests annotations) - rust-lang/rust#144143 (Fix `-Ctarget-feature`s getting ignored after `crt-static`) - rust-lang/rust#144150 (tests: assembly: cstring-merging: Disable GlobalMerge pass) - rust-lang/rust#144190 (Give a message with a span on MIR validation error) r? `@ghost` `@rustbot` modify labels: rollup
Rollup of 9 pull requests Successful merges: - rust-lang/rust#143282 (Add `uX::strict_sub_signed`) - rust-lang/rust#143423 (address clippy formatting nits) - rust-lang/rust#143720 (Allow `Rvalue::Repeat` to return true in `rvalue_creates_operand` too) - rust-lang/rust#144011 (bootstrap: Don't trigger an unnecessary LLVM build from check builds) - rust-lang/rust#144112 (bootstrap: Ignore `rust.debuginfo-level-tests` for codegen tests) - rust-lang/rust#144125 (Add new `ignore-backends` and `needs-backends` tests annotations) - rust-lang/rust#144143 (Fix `-Ctarget-feature`s getting ignored after `crt-static`) - rust-lang/rust#144150 (tests: assembly: cstring-merging: Disable GlobalMerge pass) - rust-lang/rust#144190 (Give a message with a span on MIR validation error) r? `@ghost` `@rustbot` modify labels: rollup
It was handy to get a source+line link for #143833, even if it's just to the function and not necessarily to the statement.
r? mir