提交 799cadb2 编写于 作者: O Oliver Scherer

Remove unnecessary feature gates from const fns

上级 4c0116e1
...@@ -26,7 +26,6 @@ const fn done<T>() -> *mut Arc<T> { 1_usize as *mut _ } ...@@ -26,7 +26,6 @@ const fn done<T>() -> *mut Arc<T> { 1_usize as *mut _ }
unsafe impl<T> Sync for Lazy<T> {} unsafe impl<T> Sync for Lazy<T> {}
impl<T> Lazy<T> { impl<T> Lazy<T> {
#[unstable(feature = "sys_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Lazy<T> { pub const fn new() -> Lazy<T> {
Lazy { Lazy {
lock: Mutex::new(), lock: Mutex::new(),
......
...@@ -271,6 +271,7 @@ ...@@ -271,6 +271,7 @@
#![feature(libc)] #![feature(libc)]
#![feature(link_args)] #![feature(link_args)]
#![feature(linkage)] #![feature(linkage)]
#![feature(min_const_unsafe_fn)]
#![feature(needs_panic_runtime)] #![feature(needs_panic_runtime)]
#![feature(never_type)] #![feature(never_type)]
#![feature(nll)] #![feature(nll)]
......
...@@ -18,7 +18,6 @@ pub struct Condvar { ...@@ -18,7 +18,6 @@ pub struct Condvar {
} }
impl Condvar { impl Condvar {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Condvar { pub const fn new() -> Condvar {
Condvar { inner: SpinMutex::new(WaitVariable::new(())) } Condvar { inner: SpinMutex::new(WaitVariable::new(())) }
} }
......
...@@ -20,7 +20,6 @@ pub struct Mutex { ...@@ -20,7 +20,6 @@ pub struct Mutex {
// Implementation according to “Operating Systems: Three Easy Pieces”, chapter 28 // Implementation according to “Operating Systems: Three Easy Pieces”, chapter 28
impl Mutex { impl Mutex {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Mutex { pub const fn new() -> Mutex {
Mutex { inner: SpinMutex::new(WaitVariable::new(false)) } Mutex { inner: SpinMutex::new(WaitVariable::new(false)) }
} }
...@@ -79,7 +78,6 @@ pub struct ReentrantMutex { ...@@ -79,7 +78,6 @@ pub struct ReentrantMutex {
} }
impl ReentrantMutex { impl ReentrantMutex {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn uninitialized() -> ReentrantMutex { pub const fn uninitialized() -> ReentrantMutex {
ReentrantMutex { ReentrantMutex {
inner: SpinMutex::new(WaitVariable::new(ReentrantLock { owner: None, count: 0 })) inner: SpinMutex::new(WaitVariable::new(ReentrantLock { owner: None, count: 0 }))
......
...@@ -21,7 +21,6 @@ pub struct RWLock { ...@@ -21,7 +21,6 @@ pub struct RWLock {
//unsafe impl Sync for RWLock {} // FIXME //unsafe impl Sync for RWLock {} // FIXME
impl RWLock { impl RWLock {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> RWLock { pub const fn new() -> RWLock {
RWLock { RWLock {
readers: SpinMutex::new(WaitVariable::new(None)), readers: SpinMutex::new(WaitVariable::new(None)),
......
...@@ -50,7 +50,6 @@ pub struct WaitVariable<T> { ...@@ -50,7 +50,6 @@ pub struct WaitVariable<T> {
} }
impl<T> WaitVariable<T> { impl<T> WaitVariable<T> {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new(var: T) -> Self { pub const fn new(var: T) -> Self {
WaitVariable { WaitVariable {
queue: WaitQueue::new(), queue: WaitQueue::new(),
...@@ -137,7 +136,6 @@ fn drop(&mut self) { ...@@ -137,7 +136,6 @@ fn drop(&mut self) {
} }
impl WaitQueue { impl WaitQueue {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Self { pub const fn new() -> Self {
WaitQueue { WaitQueue {
inner: UnsafeList::new() inner: UnsafeList::new()
...@@ -255,7 +253,6 @@ pub struct UnsafeList<T> { ...@@ -255,7 +253,6 @@ pub struct UnsafeList<T> {
} }
impl<T> UnsafeList<T> { impl<T> UnsafeList<T> {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Self { pub const fn new() -> Self {
unsafe { unsafe {
UnsafeList { UnsafeList {
......
...@@ -25,7 +25,6 @@ impl Condvar { ...@@ -25,7 +25,6 @@ impl Condvar {
/// ///
/// Behavior is undefined if the condition variable is moved after it is /// Behavior is undefined if the condition variable is moved after it is
/// first used with any of the functions below. /// first used with any of the functions below.
#[unstable(feature = "sys_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Condvar { Condvar(imp::Condvar::new()) } pub const fn new() -> Condvar { Condvar(imp::Condvar::new()) }
/// Prepares the condition variable for use. /// Prepares the condition variable for use.
......
...@@ -27,7 +27,6 @@ impl Mutex { ...@@ -27,7 +27,6 @@ impl Mutex {
/// Also, until `init` is called, behavior is undefined if this /// Also, until `init` is called, behavior is undefined if this
/// mutex is ever used reentrantly, i.e., `raw_lock` or `try_lock` /// mutex is ever used reentrantly, i.e., `raw_lock` or `try_lock`
/// are called by the thread currently holding the lock. /// are called by the thread currently holding the lock.
#[unstable(feature = "sys_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Mutex { Mutex(imp::Mutex::new()) } pub const fn new() -> Mutex { Mutex(imp::Mutex::new()) }
/// Prepare the mutex for use. /// Prepare the mutex for use.
......
...@@ -22,7 +22,6 @@ impl RWLock { ...@@ -22,7 +22,6 @@ impl RWLock {
/// ///
/// Behavior is undefined if the reader-writer lock is moved after it is /// Behavior is undefined if the reader-writer lock is moved after it is
/// first used with any of the functions below. /// first used with any of the functions below.
#[unstable(feature = "sys_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> RWLock { RWLock(imp::RWLock::new()) } pub const fn new() -> RWLock { RWLock(imp::RWLock::new()) }
/// Acquires shared access to the underlying lock, blocking the current /// Acquires shared access to the underlying lock, blocking the current
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册