Skip to content

Commit

Permalink
Rollup merge of rust-lang#56708 - oli-obk:stability_internal_const_fn…
Browse files Browse the repository at this point in the history
…, r=alexcrichton

Remove some unnecessary feature gates

fixes rust-lang#56585

cc @jethrogb
  • Loading branch information
kennytm authored Dec 13, 2018
2 parents d0647ec + 5457b19 commit 070443b
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 26 deletions.
1 change: 0 additions & 1 deletion src/libstd/io/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const fn done<T>() -> *mut Arc<T> { 1_usize as *mut _ }
unsafe impl<T> Sync for Lazy<T> {}

impl<T> Lazy<T> {
#[unstable(feature = "sys_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Lazy<T> {
Lazy {
lock: Mutex::new(),
Expand Down
1 change: 1 addition & 0 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@
#![feature(libc)]
#![feature(link_args)]
#![feature(linkage)]
#![cfg_attr(not(stage0), feature(min_const_unsafe_fn))]
#![feature(needs_panic_runtime)]
#![feature(never_type)]
#![feature(nll)]
Expand Down
7 changes: 0 additions & 7 deletions src/libstd/sys/sgx/abi/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ fn image_base() -> u64 {
base
}

pub fn is_enclave_range(p: *const u8, len: usize) -> bool {
let start=p as u64;
let end=start + (len as u64);
start >= image_base() &&
end <= image_base() + (unsafe { ENCLAVE_SIZE } as u64) // unsafe ok: link-time constant
}

pub fn is_user_range(p: *const u8, len: usize) -> bool {
let start=p as u64;
let end=start + (len as u64);
Expand Down
8 changes: 0 additions & 8 deletions src/libstd/sys/sgx/abi/usercalls/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ pub fn read(fd: Fd, buf: &mut [u8]) -> IoResult<usize> {
}
}

pub fn read_alloc(fd: Fd) -> IoResult<Vec<u8>> {
unsafe {
let mut userbuf = alloc::User::<ByteBuffer>::uninitialized();
raw::read_alloc(fd, userbuf.as_raw_mut_ptr()).from_sgx_result()?;
Ok(copy_user_buffer(&userbuf))
}
}

pub fn write(fd: Fd, buf: &[u8]) -> IoResult<usize> {
unsafe {
let userbuf = alloc::User::new_from_enclave(buf);
Expand Down
1 change: 0 additions & 1 deletion src/libstd/sys/sgx/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub struct Condvar {
}

impl Condvar {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Condvar {
Condvar { inner: SpinMutex::new(WaitVariable::new(())) }
}
Expand Down
2 changes: 0 additions & 2 deletions src/libstd/sys/sgx/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ pub struct Mutex {

// Implementation according to “Operating Systems: Three Easy Pieces”, chapter 28
impl Mutex {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Mutex {
Mutex { inner: SpinMutex::new(WaitVariable::new(false)) }
}
Expand Down Expand Up @@ -79,7 +78,6 @@ pub struct ReentrantMutex {
}

impl ReentrantMutex {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn uninitialized() -> ReentrantMutex {
ReentrantMutex {
inner: SpinMutex::new(WaitVariable::new(ReentrantLock { owner: None, count: 0 }))
Expand Down
1 change: 0 additions & 1 deletion src/libstd/sys/sgx/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub struct RWLock {
//unsafe impl Sync for RWLock {} // FIXME

impl RWLock {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> RWLock {
RWLock {
readers: SpinMutex::new(WaitVariable::new(None)),
Expand Down
3 changes: 0 additions & 3 deletions src/libstd/sys/sgx/waitqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ pub struct WaitVariable<T> {
}

impl<T> WaitVariable<T> {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new(var: T) -> Self {
WaitVariable {
queue: WaitQueue::new(),
Expand Down Expand Up @@ -137,7 +136,6 @@ impl<'a, T> Drop for WaitGuard<'a, T> {
}

impl WaitQueue {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Self {
WaitQueue {
inner: UnsafeList::new()
Expand Down Expand Up @@ -255,7 +253,6 @@ mod unsafe_list {
}

impl<T> UnsafeList<T> {
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
pub const fn new() -> Self {
unsafe {
UnsafeList {
Expand Down
1 change: 0 additions & 1 deletion src/libstd/sys_common/condvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ impl Condvar {
///
/// Behavior is undefined if the condition variable is moved after it is
/// 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()) }

/// Prepares the condition variable for use.
Expand Down
1 change: 0 additions & 1 deletion src/libstd/sys_common/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ impl Mutex {
/// Also, until `init` is called, behavior is undefined if this
/// mutex is ever used reentrantly, i.e., `raw_lock` or `try_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()) }

/// Prepare the mutex for use.
Expand Down
1 change: 0 additions & 1 deletion src/libstd/sys_common/rwlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ impl RWLock {
///
/// Behavior is undefined if the reader-writer lock is moved after it is
/// 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()) }

/// Acquires shared access to the underlying lock, blocking the current
Expand Down

0 comments on commit 070443b

Please sign in to comment.