-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[Nightly Regression] False positive warning with constants in conditional #47354
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
Comments
That's very likely from my miri changes. I touched the very code emitting this message and improved the code that can be evaluated. This needs an RFC (which I'm currently writing). |
Fixed since few Nightlies. |
The problem is back (rustc 1.29.0-nightly 874dec2 2018-07-21), but it's not visible compiling with just --emit=metadata (as in Issue #51491 ):
|
I'm surprised it was ever fixed. We have a test reproducing this and it hasn't been touched |
I've just hit this issue in my own code, and the problem is reproducible just by copy-pasting the above code into the Rust playground in 1.33.0-stable. I've looked around and found #52966, which was about a similar regression and was closed. If this behavior is intended, then this issue can be closed. But just to clarify, are lints causing compile-time errors a thing now? It feels like they should not, given that it makes ie. changing a |
Triage: no change |
This appears to be fixed on stable rust, dating back to rust 1.70: godbolt |
This is modified code from a real regression in my code:
D language and C++17 avoid such problems using "static if" and "if constexpr".
The text was updated successfully, but these errors were encountered: