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

@ -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