-
Notifications
You must be signed in to change notification settings - Fork 13.3k
panic msg for slicing used to contain path to user's code, now contains path to core #100696
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I didn't bisect this, but I'm about 90% sure that this is due to #94657 cc @fee1-dead |
This is a flaw in the |
This seems like a pretty unfortunate regression in ability to debug these - do we have line of sight to fixing that? If I follow the PR, it's for unstable indexing or so? (i.e., perhaps we should revert it if we can't improve the diagnostic quality here)? |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
I'll try to fix this without reverting. If you don't hear from me within the next four hours, feel free to do a revert. |
Tried and it is a bit hard. Feel free to revert now and I will followup later. |
Lets make sure we add a regression test, regardless of the solution (revert or fix). |
#100759 is in the queue and contains a regression test. |
…t_real_intrinsic, r=oli-obk,RalfJung Make `const_eval_select` a real intrinsic This fixes issues where `track_caller` functions do not have nice panic messages anymore when there is a call to the function, and uses the MIR system to replace the call instead of dispatching via lang items. Fixes rust-lang#100696.
…t_real_intrinsic, r=oli-obk,RalfJung Make `const_eval_select` a real intrinsic This fixes issues where `track_caller` functions do not have nice panic messages anymore when there is a call to the function, and uses the MIR system to replace the call instead of dispatching via lang items. Fixes rust-lang#100696.
I just noticed this regression from 1.60 to 1.61 because TRPL reasons.
Code
I tried this code:
I expected to see a panic with this message, pointing to the line in my code that caused the panic, which is what I see if I run
cargo +1.60 run
:Instead, if I run
cargo +1.61 run
, I see a panic with a message pointing to a path in core:For clearer viewing:
The core path is still what I see with
cargo +1.63 run
.Version it worked on
It most recently worked on: Rust 1.60.0
Version with regression
It stopped working with 1.61.0
rustc --version --verbose
:Other info
What's fun is because of the infrastructure I have with the book, I can see that Rust 1.47 was the first version to point to the user's code; before then it pointed to core as well.
This does NOT seem to occur with all panics coming from core; for example, trying to
unwrap
aNone
points to main:Indexing out of bounds of an array points to main:
Interestingly, slicing out of bounds of an array points to core (that is, this is the same issue):
so it doesn't appear to be a problem with panic messages in general, but something specific about slicing panics in particular.
The text was updated successfully, but these errors were encountered: