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

Feature gate calls to const fns #25880

Merged
merged 5 commits into from
May 29, 2015

Conversation

nikomatsakis
Copy link
Contributor

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

#![crate_type="rlib"]
#![feature(const_fn)]

pub const fn foo() -> usize { 22 } //~ ERROR const fn is unstable
Copy link
Member

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)

Copy link
Contributor Author

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)

@alexcrichton
Copy link
Member

@bors: r+ 808b411

@bors
Copy link
Contributor

bors commented May 29, 2015

⌛ Testing commit 808b411 with merge 8425494...

bors added a commit that referenced this pull request May 29, 2015
…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
@bors bors merged commit 808b411 into rust-lang:master May 29, 2015
@nikomatsakis nikomatsakis deleted the const-fn-feature-gate-calls branch March 30, 2016 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants