diff options
| author | bors <bors@rust-lang.org> | 2015-10-27 17:11:13 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-10-27 17:11:13 +0000 |
| commit | 540fd3aa715c8af7efb4b06b7f9ab6da398deb62 (patch) | |
| tree | 0feb30ef01a22ace949e54c28244c4ed326a2f1f /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 679b5a9faaed845bf4a4bd8fe27a2a98df78b7ad (diff) | |
| parent | 2b000feba57a324534008356909e02394784cfcc (diff) | |
| download | rust-540fd3aa715c8af7efb4b06b7f9ab6da398deb62.tar.gz rust-540fd3aa715c8af7efb4b06b7f9ab6da398deb62.zip | |
Auto merge of #26848 - oli-obk:const_fn_const_eval, r=pnkfelix
this has the funky side-effect of also allowing constant evaluation of function calls to functions that are not `const fn` as long as `check_const` didn't mark that function `NOT_CONST`
It's still not possible to call a normal function from a `const fn`, but let statements' initialization value can get const evaluated (this caused the fallout in the overflowing tests)
we can now do this:
```rust
const fn add(x: usize, y: usize) -> usize { x + y }
const ARR: [i32; add(1, 2)] = [5, 6, 7];
```
also added a test for destructuring in const fn args
```rust
const fn i((a, b): (u32, u32)) -> u32 { a + b } //~ ERROR: E0022
```
This is a **[breaking change]**, since it turns some runtime panics into compile-time errors. This statement is true for ANY improvement to the const evaluator.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
