Restrict most uses of const_fn
to min_const_fn
This commit is contained in:
parent
7b3d930ca6
commit
d125e904b5
@ -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)]
|
||||
|
@ -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)]
|
||||
|
@ -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))]
|
||||
|
@ -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))]
|
||||
|
@ -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)]
|
||||
|
@ -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"]
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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]
|
||||
}
|
||||
|
@ -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 }
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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 }
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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 }
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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() {}
|
||||
|
||||
|
@ -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,
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// compile-flags: -Cmetadata=aux
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(min_const_fn)]
|
||||
|
||||
pub const fn foo() {}
|
||||
pub const unsafe fn bar() {}
|
||||
|
@ -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
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#![crate_type="lib"]
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(min_const_fn)]
|
||||
|
||||
pub struct Foo;
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#![warn(const_err)]
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(min_const_fn)]
|
||||
|
||||
const fn foo(x: u32) -> u32 {
|
||||
x
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// compile-pass
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(min_const_fn)]
|
||||
|
||||
struct S(pub &'static u32, pub u32);
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
// compile-pass
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(min_const_fn)]
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
enum Cake {
|
||||
|
@ -10,8 +10,6 @@
|
||||
|
||||
// error-pattern: cycle detected
|
||||
|
||||
#![feature(const_fn)]
|
||||
|
||||
struct Foo {
|
||||
bytes: [u8; std::mem::size_of::<Foo>()]
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
//~^^^^^^^^^^ ERROR cycle detected when computing layout of
|
||||
|
||||
#![feature(const_fn)]
|
||||
|
||||
#![feature(core_intrinsics)]
|
||||
|
||||
use std::intrinsics;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user