Uh oh!
There was an error while loading. Please reload this page.
Miri: improve spans of required_const failures - #75396
Conversation
RalfJung
commented
Aug 11, 2020
To do better, we'd have to either
In the light of this chaos, I am not sure I want to add yet another pub loc:Option<mir::Location>,by something of a type like |
oli-obk
commented
Aug 11, 2020
Yes, I also prefer that proposal. Although |
RalfJung
commented
Aug 11, 2020
Or rather, |
RalfJung
commented
Aug 11, 2020
All right, I implemented that now. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
RalfJung
commented
Aug 12, 2020
@bors r=oli-obk |
bors
commented
Aug 12, 2020
📌 Commit 8fc28352e8f99df9a8fd965587ffccc3bd682dcd has been approved by |
RalfJung
commented
Aug 12, 2020
@bors r- |
RalfJung
commented
Aug 12, 2020
Hu, a test failure but local runs don't show anything?? |
RalfJung
commented
Aug 12, 2020
Ah looks like that test was changed recently even though it already existed before... very strange. |
RalfJung
commented
Aug 12, 2020
Also how horrible is GitHub? Why can I not go to the git log from https://github.com/rust-lang/rust/blob/d45dcb509527d847c7c3bf459a0e796801067b33/src/test/ui/consts/uninhabited-const-issue-61744.stderr ? I thought that used to be possible? |
RalfJung
commented
Aug 12, 2020
Hm, that test also did not change recently. So it must be some other change on the rustc side that makes it such that in combination with this PR, the output for that test changes. WTF. |
RalfJung
commented
Aug 12, 2020
Oh I see, this is a stack overflow, so it likely interacts with #75338. |
RalfJung
left a comment
There was a problem hiding this comment.
(wow GitHub is really making my life as hard as possible today. now it started a review...)
There was a problem hiding this comment.
It's about the order of these two lines: for errors that happen during after_stack_push, so we want to use the span of the first statement, or the span of the entire body? IMO the latter makes more sense, the first statement has nothing to do with this.
For the stack overflow, probably the best span to use would be that of the call site.
There was a problem hiding this comment.
yea, the body's span is good here, though it's actually the call site's fault. But lets leave such refactorings (using the call site span) to the future, I remember trying something similar a while back and it just complicated the span scheme even more
There was a problem hiding this comment.
Hm, this wouldn't even be that hard I think... we can just call cur_span before pushing the new frame, then we should get the call site.
There was a problem hiding this comment.
It's just not clear to me that we always want the call site. The callee could also be responsible for the problem -- in fact I'd usually think they are.
There was a problem hiding this comment.
at runtime the decision whose job it is to create the stack frame is an ABI decision, but that doesn't really make sense for CTFE. But I also think your alluding to a different thing? If an required_const will fail regardless of the concrete generic parameters, then that's indeed the function's fault and not the caller's
There was a problem hiding this comment.
If an required_const will fail regardless of the concrete generic parameters, then that's indeed the function's fault and not the caller's
Yes, that is one possible scenario I had in mind where blaming the caller seems wrong.
bors
commented
Aug 12, 2020
📌 Commit fd32fe9 has been approved by |
bors
commented
Aug 12, 2020
⌛ Testing commit fd32fe9 with merge 5c8f1c241f7babd2356f080b77258174dcbf5da6... |
rust-log-analyzer
commented
Aug 12, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
commented
Aug 12, 2020
💔 Test failed - checks-actions |
RalfJung
commented
Aug 12, 2020
Seems spurious to me... I hope.^^ |
bors
commented
Aug 12, 2020
⌛ Testing commit fd32fe9 with merge 0ac354c868c8238b48198d9bac75bd17719505e3... |
rust-log-analyzer
commented
Aug 12, 2020
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
bors
commented
Aug 12, 2020
💔 Test failed - checks-actions |
RalfJung
commented
Aug 12, 2020
@rust-lang/infra Any idea what is happening? |
emilyalbini
commented
Aug 12, 2020
@bors treeclosed=1000 |
emilyalbini
commented
Aug 12, 2020
Fixing CI in #75450. |
bors
commented
Aug 12, 2020
bors
commented
Aug 12, 2020
☀️ Test successful - checks-actions, checks-azure |
In #75339 I added a loop evaluating all consts required by a function body. Unfortunately, if one of their evaluations fails, then the span used for that was that of the first statement in the function body, which happened to work form some existing test but is not sensible in general.
This PR changes it to point to the whole function instead, which is at least not wrong.
r? @oli-obk