-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Feature gate calls to const fns #25880
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
Feature gate calls to const fns #25880
Conversation
#![crate_type="rlib"] | ||
#![feature(const_fn)] | ||
|
||
pub const fn foo() -> usize { 22 } //~ ERROR const fn is unstable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may be a stray ERROR
annotation (I also think the explicit crate_type
isn't necessary)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it is. I like having the crate_type there though because it makes it easier to run the tests by hand (I don't have to remember to pass --crate-type
)
…excrichton The previous feature gate assumed we would not define any (stable) const fns. But then @eddyb went and cleaned up the code. So this now extends the feature-gate to prohibit calls; but calls inside of macros are considered ok. r? @alexcrichton
The previous feature gate assumed we would not define any (stable) const fns. But then @eddyb went and cleaned up the code. So this now extends the feature-gate to prohibit calls; but calls inside of macros are considered ok.
r? @alexcrichton