Uh oh!
There was an error while loading. Please reload this page.
Initial implementation of const fn - #25609
Conversation
nikomatsakis
commented
May 19, 2015
Oh, I've run tests locally, but not since rebasing. make check is running now. |
There was a problem hiding this comment.
tidy fails on this, it should be FIXME
There was a problem hiding this comment.
No, it should not be a FIXME. I always put TODOs intentionally so that I actually am forced to DO the things in question. In this case, though, I DID do that, but forgot I made the TODO list, so I should just remove the comment...
bors
commented
May 19, 2015
☔ The latest upstream changes (presumably #24333) made this pull request unmergeable. Please resolve the merge conflicts. |
nikomatsakis
commented
May 20, 2015
Rebased. But when I run |
- add feature gate - add basic tests - adjust parser to eliminate conflict between `const fn` and associated constants - allow `const fn` in traits/trait-impls, but forbid later in type check - correct some merge conflicts
nikomatsakis
commented
May 22, 2015
Passes everything now. |
pnkfelix
commented
May 24, 2015
@nikomatsakis if you're still looking for suggestions of tests to add, I noticed that while you have both You might also add tests that uses of conditional ( |
pnkfelix
commented
May 24, 2015
It overall looks good to me; I'm going to r+ it and we can add more tests later, just to avoid future rebase pain. |
pnkfelix
commented
May 24, 2015
bors
commented
May 24, 2015
This is a port of @eddyb's `const-fn` branch. I rebased it, tweaked a few things, and added tests as well as a feature gate. The set of tests is still pretty rudimentary, I'd appreciate suggestions on new tests to write. Also, a double-check that the feature-gate covers all necessary cases. One question: currently, the feature-gate allows the *use* of const functions from stable code, just not the definition. This seems to fit our usual strategy, and implies that we might (perhaps) allow some constant functions in libstd someday, even before stabilizing const-fn, if we were willing to commit to the existence of const fns but found some details of their impl unsatisfactory. r? @pnkfelix
This is a port of @eddyb's
const-fnbranch. I rebased it, tweaked a few things, and added tests as well as a feature gate. The set of tests is still pretty rudimentary, I'd appreciate suggestions on new tests to write. Also, a double-check that the feature-gate covers all necessary cases.One question: currently, the feature-gate allows the use of const functions from stable code, just not the definition. This seems to fit our usual strategy, and implies that we might (perhaps) allow some constant functions in libstd someday, even before stabilizing const-fn, if we were willing to commit to the existence of const fns but found some details of their impl unsatisfactory.
r? @pnkfelix