]> git.lizzy.rs Git - rust.git/commit
Auto merge of #25609 - nikomatsakis:const-fn, r=pnkfelix
authorbors <bors@rust-lang.org>
Sun, 24 May 2015 11:12:34 +0000 (11:12 +0000)
committerbors <bors@rust-lang.org>
Sun, 24 May 2015 11:12:34 +0000 (11:12 +0000)
commitba0e1cd8147d452c356aacb29fb87568ca26f111
tree0cf03636be9210de94e30bb07467097aeb5273c7
parentcc56c20ba4ccc12f58e1c844b77168bc4805cbb6
parent82ded3cd03e001e82b9dce9aedac621a5292231b
Auto merge of #25609 - nikomatsakis:const-fn, r=pnkfelix

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
src/librustc_lint/builtin.rs
src/libsyntax/ext/expand.rs
src/libsyntax/feature_gate.rs