Restrict most uses of const_fn to min_const_fn

This commit is contained in:
Oliver Schneider 2018-08-29 13:20:43 +02:00
parent 7b3d930ca6
commit d125e904b5
41 changed files with 43 additions and 42 deletions

View File

@ -88,7 +88,8 @@
#![feature(box_syntax)]
#![feature(cfg_target_has_atomic)]
#![feature(coerce_unsized)]
#![feature(const_fn)]
#![cfg_attr(stage0, feature(const_fn))]
#![cfg_attr(not(stage0), feature(min_const_fn))]
#![feature(core_intrinsics)]
#![feature(custom_attribute)]
#![feature(dropck_eyepatch)]

View File

@ -11,7 +11,8 @@
#![feature(allocator_api)]
#![feature(alloc_system)]
#![feature(box_syntax)]
#![feature(const_fn)]
#![cfg_attr(stage0, feature(const_fn))]
#![cfg_attr(not(stage0), feature(min_const_fn))]
#![feature(drain_filter)]
#![feature(exact_size_is_empty)]
#![feature(pattern)]

View File

@ -42,7 +42,8 @@
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(const_fn)]
#![cfg_attr(stage0, feature(const_fn))]
#![cfg_attr(not(stage0), feature(min_const_fn))]
#![feature(core_intrinsics)]
#![feature(drain_filter)]
#![cfg_attr(windows, feature(libc))]

View File

@ -23,7 +23,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(crate_visibility_modifier)]
#![feature(const_fn)]
#![feature(core_intrinsics)]
#![feature(decl_macro)]
#![cfg_attr(stage0, feature(macro_vis_matcher))]

View File

@ -22,7 +22,8 @@
html_root_url = "https://doc.rust-lang.org/nightly/")]
#![feature(box_syntax)]
#![feature(const_fn)]
#![cfg_attr(stage0, feature(const_fn))]
#![cfg_attr(not(stage0), feature(min_const_fn))]
#![cfg_attr(not(stage0), feature(nll))]
#![cfg_attr(not(stage0), feature(infer_outlives_requirements))]
#![feature(slice_patterns)]

View File

@ -13,7 +13,7 @@
// NB: We do not expect *any* monomorphization to be generated here.
#![feature(const_fn)]
#![feature(min_const_fn)]
#![deny(dead_code)]
#![crate_type = "rlib"]

View File

@ -10,7 +10,7 @@
// compile-flags:-Clink-dead-code
#![feature(const_fn)]
#![feature(min_const_fn)]
#![crate_type = "rlib"]
// This test makes sure that, when -Clink-dead-code is specified, we generate

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
#![feature(cfg_target_thread_local, thread_local_internals)]
// On platforms *without* `#[thread_local]`, use

View File

@ -15,7 +15,7 @@
// compile-flags: -Z lower_128bit_ops=yes -C debug_assertions=yes
#![feature(const_fn)]
#![feature(min_const_fn)]
static TEST_SIGNED: i128 = const_signed(-222);
static TEST_UNSIGNED: u128 = const_unsigned(200);

View File

@ -12,7 +12,7 @@
// compile-flags: -Z lower_128bit_ops=yes -C debug_assertions=no -O
#![feature(const_fn)]
#![feature(min_const_fn)]
static TEST_SIGNED: i128 = const_signed(-222);
static TEST_UNSIGNED: u128 = const_unsigned(200);

View File

@ -10,7 +10,7 @@
// error-pattern:index out of bounds: the len is 5 but the index is 5
#![feature(const_fn)]
#![feature(min_const_fn)]
const fn test(x: usize) -> i32 {
[42;5][x]
}

View File

@ -11,6 +11,6 @@
// Crate that exports a const fn. Used for testing cross-crate.
#![crate_type="rlib"]
#![feature(const_fn)]
#![feature(min_const_fn)]
pub const fn foo() -> usize { 22 }

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
#![crate_type = "lib"]
const fn foo(i: i32) -> i32 {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
const fn add(x: usize, y: usize) -> usize {
x + y

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
struct Foo { value: u32 }

View File

@ -10,7 +10,7 @@
// Test a call whose argument is the result of another call.
#![feature(const_fn)]
#![feature(min_const_fn)]
const fn sub(x: u32, y: u32) -> u32 {
x - y

View File

@ -7,7 +7,7 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
struct A;

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
#[derive(PartialEq, Eq)]
enum Cake {

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
use std::mem;

View File

@ -10,7 +10,7 @@
// A quick test of 'unsafe const fn' functionality
#![feature(const_fn)]
#![feature(min_const_fn)]
const unsafe fn dummy(v: u32) -> u32 {
!v

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
const FOO: isize = 10;
const BAR: isize = 3;

View File

@ -10,7 +10,7 @@
// https://github.com/rust-lang/rust/issues/48279
#![feature(const_fn)]
#![feature(min_const_fn)]
#[derive(PartialEq, Eq)]
pub struct NonZeroU32 {

View File

@ -10,7 +10,7 @@
// https://github.com/rust-lang/rust/issues/46114
#![feature(const_fn)]
#![feature(min_const_fn)]
#[derive(Eq, PartialEq)]
struct A { value: u32 }

View File

@ -10,7 +10,7 @@
// https://github.com/rust-lang/rust/issues/43754
#![feature(const_fn)]
#![feature(min_const_fn)]
const fn foo(x: usize) -> usize {
return x;
}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
fn main() {}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
struct A {
field: usize,
}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
const fn foo() -> *const i8 {
b"foo" as *const _ as *const i8

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
const fn foo() -> i64 {
3

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
const fn f() -> usize {
5
}

View File

@ -10,7 +10,7 @@
// compile-flags: -Cmetadata=aux
#![feature(const_fn)]
#![feature(min_const_fn)]
pub const fn foo() {}
pub const unsafe fn bar() {}

View File

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(const_fn)]
#![feature(min_const_fn)]
#![crate_name = "foo"]
// @has foo/fn.bar.html

View File

@ -10,7 +10,7 @@
#![crate_type="lib"]
#![feature(const_fn)]
#![feature(min_const_fn)]
pub struct Foo;

View File

@ -15,7 +15,7 @@
// permitted as `Foo` is not copy (even in a static/const
// initializer).
#![feature(const_fn)]
#![feature(min_const_fn)]
struct Foo(usize);

View File

@ -11,6 +11,6 @@
// Crate that exports a const fn. Used for testing cross-crate.
#![crate_type="rlib"]
#![feature(const_fn)]
#![feature(min_const_fn)]
pub const fn foo() -> usize { 22 } //~ ERROR const fn is unstable

View File

@ -10,7 +10,7 @@
#![warn(const_err)]
#![feature(const_fn)]
#![feature(min_const_fn)]
const fn foo(x: u32) -> u32 {
x

View File

@ -10,7 +10,7 @@
// compile-pass
#![feature(const_fn)]
#![feature(min_const_fn)]
struct S(pub &'static u32, pub u32);

View File

@ -10,7 +10,7 @@
// compile-pass
#![feature(const_fn)]
#![feature(min_const_fn)]
#[derive(PartialEq, Eq)]
enum Cake {

View File

@ -10,8 +10,6 @@
// error-pattern: cycle detected
#![feature(const_fn)]
struct Foo {
bytes: [u8; std::mem::size_of::<Foo>()]
}

View File

@ -10,7 +10,7 @@
//https://github.com/rust-lang/rust/issues/31364
#![feature(const_fn)]
#![feature(min_const_fn)]
const fn a() -> usize { b() }
const fn b() -> usize { a() }
const ARR: [i32; a()] = [5; 6]; //~ ERROR could not evaluate constant expression

View File

@ -10,7 +10,7 @@
//~^^^^^^^^^^ ERROR cycle detected when computing layout of
#![feature(const_fn)]
#![feature(core_intrinsics)]
use std::intrinsics;

View File

@ -10,7 +10,7 @@
// A quick test of 'unsafe const fn' functionality
#![feature(const_fn)]
#![feature(min_const_fn)]
const unsafe fn dummy(v: u32) -> u32 {
!v