From 681e5da61ee3f1251c00c2ec0d93dd23dbf861bc Mon Sep 17 00:00:00 2001 From: Alex Burka Date: Fri, 8 Sep 2017 18:26:54 +0000 Subject: change #![feature(const_fn)] to specific gates --- src/test/compile-fail/const-call.rs | 2 -- src/test/compile-fail/const-fn-stability-calls.rs | 34 ---------------------- .../compile-fail/dropck_trait_cycle_checked.rs | 2 +- .../functional-struct-update-respects-privacy.rs | 2 -- src/test/compile-fail/issue-17718-const-borrow.rs | 2 +- src/test/compile-fail/issue-43733-2.rs | 2 +- src/test/compile-fail/issue-7364.rs | 5 ++-- 7 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 src/test/compile-fail/const-fn-stability-calls.rs (limited to 'src/test/compile-fail') diff --git a/src/test/compile-fail/const-call.rs b/src/test/compile-fail/const-call.rs index 0745ac02d07..18476494300 100644 --- a/src/test/compile-fail/const-call.rs +++ b/src/test/compile-fail/const-call.rs @@ -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 } diff --git a/src/test/compile-fail/const-fn-stability-calls.rs b/src/test/compile-fail/const-fn-stability-calls.rs deleted file mode 100644 index 609077663ef..00000000000 --- a/src/test/compile-fail/const-fn-stability-calls.rs +++ /dev/null @@ -1,34 +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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test use of const fn from another crate without a feature gate. - -// aux-build:const_fn_lib.rs - -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 - -macro_rules! constant { - ($n:ident: $t:ty = $v:expr) => { - const $n: $t = $v; - } -} - -constant! { - BAZ: usize = foo() //~ ERROR const fns are an unstable feature -} - -fn main() { -// let x: [usize; foo()] = []; -} diff --git a/src/test/compile-fail/dropck_trait_cycle_checked.rs b/src/test/compile-fail/dropck_trait_cycle_checked.rs index e701718028a..c0f0e3650d9 100644 --- a/src/test/compile-fail/dropck_trait_cycle_checked.rs +++ b/src/test/compile-fail/dropck_trait_cycle_checked.rs @@ -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; diff --git a/src/test/compile-fail/functional-struct-update-respects-privacy.rs b/src/test/compile-fail/functional-struct-update-respects-privacy.rs index d2df0d9ef27..3f41401eb69 100644 --- a/src/test/compile-fail/functional-struct-update-respects-privacy.rs +++ b/src/test/compile-fail/functional-struct-update-respects-privacy.rs @@ -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; diff --git a/src/test/compile-fail/issue-17718-const-borrow.rs b/src/test/compile-fail/issue-17718-const-borrow.rs index 327b6946822..1464fcd9a1c 100644 --- a/src/test/compile-fail/issue-17718-const-borrow.rs +++ b/src/test/compile-fail/issue-17718-const-borrow.rs @@ -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; diff --git a/src/test/compile-fail/issue-43733-2.rs b/src/test/compile-fail/issue-43733-2.rs index 0fd31454596..1bf165c89d3 100644 --- a/src/test/compile-fail/issue-43733-2.rs +++ b/src/test/compile-fail/issue-43733-2.rs @@ -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 diff --git a/src/test/compile-fail/issue-7364.rs b/src/test/compile-fail/issue-7364.rs index bd32317ae78..ef53be75780 100644 --- a/src/test/compile-fail/issue-7364.rs +++ b/src/test/compile-fail/issue-7364.rs @@ -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> = box RefCell::new(0); //~^ ERROR allocations are not allowed in statics //~| ERROR `std::cell::RefCell: std::marker::Sync` is not satisfied +//~| WARN unsupported constant expr fn main() { } -- cgit 1.4.1-3-g733a5