Uh oh!
There was an error while loading. Please reload this page.
[WIP] Warnings on long running constant evaluations - #50859
Conversation
oli-obk
left a comment
There was a problem hiding this comment.
Would you be so kind as to also add a bunch of tests that show various use cases of the lint with different lint levels and across const fn calls with different lint levels?
There was a problem hiding this comment.
So this alone won't cause const eval to abort. You should be able to run
tcx.lint_level_at_node(lint, id).0 == Level::Denyto figure out whether the lint is denied.
This means you need to do that check for all stack frames (and not just the first local one), then report the lint at the most extreme level (forbid/deny) and if it is either forbid or deny, return a constant evaluation error here.
if all lint levels are allow or warn, continue the evaluation.
There was a problem hiding this comment.
N.B. There exists more than a single error lint level (e.g. Level::Fatal iirc).
There was a problem hiding this comment.
This should also filter out all frames that are Allow, because the lint won't get reported there anyway, but if some frame wants to report the lint, then it should.
This means there might be no frames that we report anything on. In that case just don't emit the lint and only reset the terminators_remaining counter.
There was a problem hiding this comment.
@oli-obk thank you, the suggestions will be addressed soon.
This comment has been minimized.
This comment has been minimized.
oli-obk
commented
May 18, 2018
Actually, that travis failure makes me think... Maybe we should be using the This means that the changes described above should be done inside the |
7ac7abc to
eeec217CompareTimNN
commented
May 22, 2018
@csmoe: It looks like your recent push didn't include any changes except the lint declaration, was that intentional? |
csmoe
commented
May 24, 2018
@TimNN That isn't all, I'm working on this, once it's done, I'd ping for review. |
TimNN
commented
May 24, 2018
@csmoe No problem, take your time! I was just surprised since the PR history indicates that earlier versions already contained code changes. |
shepmaster
commented
Jun 2, 2018
Ping from triage, @csmoe ! We haven't heard from you in a while; are you still working on this? |
This comment has been minimized.
This comment has been minimized.
bors
commented
Jun 6, 2018
☔ The latest upstream changes (presumably #51316) made this pull request unmergeable. Please resolve the merge conflicts. |
1ad4a20 to
4074cd0Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
emilyalbini
commented
Jun 18, 2018
Ping from triage @csmoe! It's been a while since we heard from you, will you have time to work on this again? |
emilyalbini
commented
Jun 25, 2018
Thank you for this PR @csmoe! Unfortunately we haven't heard from you on this in a while, so I'm closing the PR to keep things tidy. Don't worry though, if you'll have time again in the future please reopen this PR, we'll be happy to review it again! |
#Fixes#49980
r? @oli-obk