-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Tracking issue for constant prop not causing add'l errors (RFC #1229) #28238
Comments
Can we move the errors fn foo<T>() -> u8 { 1 + 255 }
fn bar<T>() -> u8 { 1 / 0 }
|
@eddyb: that sounds reasonable as a second step, but is orthogonal to the RFC. I also don't want to create a humongous PR, so I'll address the port to |
This PR turns statically known erroneous code (e.g. numeric overflow) into a warning and continues normal code-generation to emit the same code that would have been generated without `check_const` detecting that the result can be computed at compile-time. <del>It's not done yet, as I don't know how to properly emit a lint from trans. I can't seem to extract the real lint level of the item the erroneous expression is in.</del> It's an unconditional warning now. r? @pnkfelix cc @nikomatsakis * [RFC 1229 text](https://github.com/rust-lang/rfcs/blob/master/text/1229-compile-time-asserts.md) * RFC PR: rust-lang/rfcs#1229 * tracking issue: #28238
@eddyb This is ancient. Can it move forward yet? |
@brson Nope, this is blocked on miri! |
@eddyb What is currently blocking this issue? |
The new const propagator needs to be fixed to actually lint these functions
|
We are now checking everything properly. I don't remember if my comment was wrong or if it got addressed. |
Tracking issue for rust-lang/rfcs#1229
cc @oli-obk
The text was updated successfully, but these errors were encountered: