]> git.lizzy.rs Git - rust.git/commit
Auto merge of #43017 - durka:stabilize-const-invocation, r=eddyb
authorbors <bors@rust-lang.org>
Sat, 16 Sep 2017 17:02:17 +0000 (17:02 +0000)
committerbors <bors@rust-lang.org>
Sat, 16 Sep 2017 17:02:17 +0000 (17:02 +0000)
commitae8efdc87d5f4e22e05e1b60a72272cee87fa74c
treefc7932f915f347bd68db4143b2e097e620faa538
parentb965d55a3214b78ec9ffdd3017cb6aaa62c28059
parent332c38cd70e372f56356e02b18b88919fcb58a66
Auto merge of #43017 - durka:stabilize-const-invocation, r=eddyb

Individualize feature gates for const fn invocation

This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward.

This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review.

- `std::cell`
    - `Cell::new`
    - `RefCell::new`
    - `UnsafeCell::new`
- `std::mem`
    - `size_of`
    - `align_of`
- `std::ptr`
    - `null`
    - `null_mut`
- `std::sync`
    - `atomic`
        - `Atomic{Bool,Ptr,Isize,Usize}::new`
    - `once`
        - `Once::new`
- primitives
    - `{integer}::min_value`
    - `{integer}::max_value`

Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time.

After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR.

- `std::sync`
    - `atomic`
        - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT`
    - `once`
        - `ONCE_INIT`
src/Cargo.lock
src/libcore/mem.rs