change #![feature(const_fn)] to specific gates
This commit is contained in:
parent
a12d0d4f66
commit
681e5da61e
49 changed files with 127 additions and 75 deletions
|
|
@ -16,7 +16,8 @@
|
|||
// which is a reduction of this code to more directly show the reason
|
||||
// for the error message we see here.)
|
||||
|
||||
#![feature(const_fn, rustc_private)]
|
||||
#![feature(rustc_private)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
extern crate arena;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(const_fn)]
|
||||
|
||||
fn f(x: usize) -> usize {
|
||||
x
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
//
|
||||
// (Compare against compile-fail/dropck_vec_cycle_checked.rs)
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::cell::Cell;
|
||||
use id::Id;
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
// RFC 736 (and Issue 21407): functional struct update should respect privacy.
|
||||
|
||||
#![feature(const_fn)]
|
||||
|
||||
// The `foo` module attempts to maintains an invariant that each `S`
|
||||
// has a unique `u64` id.
|
||||
use self::foo::S;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_unsafe_cell_new)]
|
||||
|
||||
use std::cell::UnsafeCell;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_fn, const_cell_new, const_unsafe_cell_new)]
|
||||
#![feature(cfg_target_thread_local, thread_local_internals)]
|
||||
|
||||
// On platforms *without* `#[thread_local]`, use
|
||||
|
|
|
|||
|
|
@ -8,9 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(box_syntax)]
|
||||
#![feature(const_fn)]
|
||||
#![allow(warnings)]
|
||||
#![feature(box_syntax, const_refcell_new)]
|
||||
|
||||
use std::cell::RefCell;
|
||||
|
||||
|
|
@ -18,5 +16,6 @@ use std::cell::RefCell;
|
|||
static boxed: Box<RefCell<isize>> = box RefCell::new(0);
|
||||
//~^ ERROR allocations are not allowed in statics
|
||||
//~| ERROR `std::cell::RefCell<isize>: std::marker::Sync` is not satisfied
|
||||
//~| WARN unsupported constant expr
|
||||
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#![allow(dead_code, unused_variables)]
|
||||
#![feature(omit_gdb_pretty_printer_section)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_unsafe_cell_new)]
|
||||
#![feature(static_mutex)]
|
||||
|
||||
// This test makes sure that the compiler doesn't crash when trying to assign
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// no-prefer-dynamic
|
||||
|
||||
#![allow(dead_code)]
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
// check dtor calling order when casting enums.
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// `Item` originates in a where-clause, not the declaration of
|
||||
// `T`. Issue #20300.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::marker::{PhantomData};
|
||||
use std::sync::atomic::{AtomicUsize};
|
||||
|
|
|
|||
|
|
@ -13,4 +13,4 @@
|
|||
#![crate_type="rlib"]
|
||||
#![feature(const_fn)]
|
||||
|
||||
pub const fn foo() -> usize { 22 } //~ ERROR const fn is unstable
|
||||
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(const_atomic_usize_new)]
|
||||
|
||||
use std::sync::atomic;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
#![feature(cfg_target_thread_local, const_fn, thread_local)]
|
||||
#![feature(const_cell_new)]
|
||||
#![crate_type = "lib"]
|
||||
|
||||
#[cfg(target_thread_local)]
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
// ignore-emscripten no threads support
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::thread;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
// ignore-emscripten no threads support
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::thread;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <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.
|
||||
|
||||
// aux-build:const_fn_lib.rs
|
||||
|
||||
// A very basic test of const fn functionality.
|
||||
|
||||
#![feature(const_fn)]
|
||||
|
||||
extern crate const_fn_lib;
|
||||
|
||||
use const_fn_lib::foo;
|
||||
|
||||
const FOO: usize = foo();
|
||||
|
||||
fn main() {
|
||||
assert_eq!(FOO, 22);
|
||||
let _: [i32; foo()] = [42; 22];
|
||||
}
|
||||
|
|
@ -16,8 +16,8 @@ extern crate const_fn_lib;
|
|||
|
||||
use const_fn_lib::foo;
|
||||
|
||||
static FOO: usize = foo(); //~ ERROR const fns are an unstable feature
|
||||
const BAR: usize = foo(); //~ ERROR const fns are an unstable feature
|
||||
static FOO: usize = foo();
|
||||
const BAR: usize = foo();
|
||||
|
||||
macro_rules! constant {
|
||||
($n:ident: $t:ty = $v:expr) => {
|
||||
|
|
@ -26,9 +26,9 @@ macro_rules! constant {
|
|||
}
|
||||
|
||||
constant! {
|
||||
BAZ: usize = foo() //~ ERROR const fns are an unstable feature
|
||||
BAZ: usize = foo()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// let x: [usize; foo()] = [];
|
||||
let x: [usize; foo()] = [42; foo()];
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_fn, const_size_of, const_align_of)]
|
||||
|
||||
use std::mem;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@
|
|||
// pretty-expanded FIXME #23616
|
||||
|
||||
#![feature(core)]
|
||||
#![feature(const_fn)]
|
||||
|
||||
#![feature(const_unsafe_cell_new)]
|
||||
|
||||
use std::marker;
|
||||
use std::cell::UnsafeCell;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
|
||||
#![feature(core)]
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
extern crate issue_17718_aux as other;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
// created via FRU and control-flow breaks in the middle of
|
||||
// construction.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::sync::atomic::{Ordering, AtomicUsize};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
|
||||
// ignore-emscripten no threads support
|
||||
|
||||
#![feature(const_fn)]
|
||||
|
||||
// Check that the destructors of simple enums are run on unwinding
|
||||
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::sync::atomic::{Ordering, AtomicUsize};
|
||||
use std::thread;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::sync::atomic::{Ordering, AtomicUsize};
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
// the contents implement Drop and we hit a panic in the middle of
|
||||
// construction.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::thread;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
|
|
|||
|
|
@ -10,7 +10,8 @@
|
|||
|
||||
// ignore-emscripten no threads support
|
||||
|
||||
#![feature(panic_handler, const_fn, std_panic)]
|
||||
#![feature(panic_handler, std_panic)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::panic;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@
|
|||
// <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(panic_handler, const_fn, std_panic)]
|
||||
#![feature(panic_handler, std_panic)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
// ignore-emscripten no threads support
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// Checks that functional-record-update order-of-eval is as expected
|
||||
// even when no Drop-implementations are involved.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::sync::atomic::{Ordering, AtomicUsize};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
// Checks that struct-literal expression order-of-eval is as expected
|
||||
// even when no Drop-implementations are involved.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::sync::atomic::{Ordering, AtomicUsize};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@
|
|||
|
||||
// ignore-emscripten no threads support
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(rand)]
|
||||
#![feature(sort_unstable)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::__rand::{thread_rng, Rng};
|
||||
use std::cell::Cell;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
//
|
||||
// (Compare against compile-fail/dropck_vec_cycle_checked.rs)
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::cell::Cell;
|
||||
use id::Id;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
//
|
||||
// (Compare against compile-fail/dropck_arr_cycle_checked.rs)
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::cell::Cell;
|
||||
use id::Id;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
// conditions above to be satisfied, meaning that if the dropck is
|
||||
// sound, it should reject this code.
|
||||
|
||||
#![feature(const_fn)]
|
||||
#![feature(const_atomic_usize_new)]
|
||||
|
||||
use std::cell::Cell;
|
||||
use id::Id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue