Skip to content
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

Overflowing literal lint is silenced in range literals in loops on nightly #60459

Closed
varkor opened this issue May 1, 2019 · 6 comments · Fixed by #61098
Closed

Overflowing literal lint is silenced in range literals in loops on nightly #60459

varkor opened this issue May 1, 2019 · 6 comments · Fixed by #61098
Assignees
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@varkor
Copy link
Member

varkor commented May 1, 2019

fn main() {
    for _ in 0..256u8 {} // should warn
}

since #60330.

@varkor varkor added the A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. label May 1, 2019
@varkor varkor self-assigned this May 1, 2019
@varkor
Copy link
Member Author

varkor commented May 1, 2019

It is hitting the err.emit() here:

err.emit();

So I'm not quite sure why the error isn't being emitted yet.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 2, 2019
@ehuss
Copy link
Contributor

ehuss commented May 2, 2019

It appears to be hitting this line of code which is cancelling the diagnostic:

err.cancel()

This was referenced May 13, 2019
@pnkfelix
Copy link
Member

this appears to be a stable-to-beta regression (playpen)

@pnkfelix
Copy link
Member

triage: P-high. Assigning to self.

@pnkfelix pnkfelix self-assigned this May 23, 2019
@pnkfelix pnkfelix added P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels May 23, 2019
@estebank
Copy link
Contributor

We need to change

ExpnFormat::CompilerDesugaring(_) => return true, // well, it's "external"
to not consider desugarings coming from for loops as external. If that has regressions in our test suite, then we can add a new desugaring kind to differentiate between different parts of the for loop desugaring and target it further, but I do not expect that to be needed.

@varkor
Copy link
Member Author

varkor commented May 23, 2019

@pnkfelix: I've opened #61098 with a fix, based on @estebank's comment.

Centril added a commit to Centril/rust that referenced this issue May 23, 2019
…oop, r=estebank

Fix overflowing literal lint in loops

Fixes rust-lang#60459.

r? @estebank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-bug Category: This is a bug. P-high High priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants