-
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
rustc_const_unstable should check constness #69630
Comments
Oh yea, that's a good idea. Note that this can't be done for intrinsics at this point, so you need to make sure to only check |
I'd be happy and try to implement this. However Im not verry familiar with the compiler structure. |
I didn't find a good entry point. I guess you could pass rust/src/librustc_passes/stability.rs Line 289 in beac68a
i fields and then check i.kind in rust/src/librustc_passes/stability.rs Line 83 in beac68a
const (and doesn't have intrinsic Abi). Not sure how messy that gets, but if it's fairly contained, that seems ok to me.
|
I am interested in working on this! Could I get assigned to this? I already have a PR for this I think |
@lambinoo You can use the |
Oooh, thanks! :D |
…e_check_const, r=oli-obk Checking that function is const if marked with rustc_const_unstable Fixes rust-lang#69630 This one is still missing tests to check the behavior but I checked by hand and it seemed to work. I would not mind some direction for writing those unit tests!
The
rustc_const_unstable
attribute currently does not check whether the function it is applied upon is indeed aconst fn
. I feel like it should check that.I recently made the mistake of forgetting to mark the function const: #69617 (comment)
ping @oli-obk
The text was updated successfully, but these errors were encountered: