Skip to content

Commit 33a94f1

Browse files
authored
Rollup merge of rust-lang#56708 - oli-obk:stability_internal_const_fn, r=alexcrichton
Remove some unnecessary feature gates fixes rust-lang#56585 cc @jethrogb
2 parents 6a9854c + 5457b19 commit 33a94f1

File tree

11 files changed

+1
-26
lines changed

11 files changed

+1
-26
lines changed

src/libstd/io/lazy.rs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const fn done<T>() -> *mut Arc<T> { 1_usize as *mut _ }
2626
unsafe impl<T> Sync for Lazy<T> {}
2727

2828
impl<T> Lazy<T> {
29-
#[unstable(feature = "sys_internals", issue = "0")] // FIXME: min_const_fn
3029
pub const fn new() -> Lazy<T> {
3130
Lazy {
3231
lock: Mutex::new(),

src/libstd/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@
271271
#![feature(libc)]
272272
#![feature(link_args)]
273273
#![feature(linkage)]
274+
#![cfg_attr(not(stage0), feature(min_const_unsafe_fn))]
274275
#![feature(needs_panic_runtime)]
275276
#![feature(never_type)]
276277
#![feature(nll)]

src/libstd/sys/sgx/abi/mem.rs

-7
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ fn image_base() -> u64 {
3434
base
3535
}
3636

37-
pub fn is_enclave_range(p: *const u8, len: usize) -> bool {
38-
let start=p as u64;
39-
let end=start + (len as u64);
40-
start >= image_base() &&
41-
end <= image_base() + (unsafe { ENCLAVE_SIZE } as u64) // unsafe ok: link-time constant
42-
}
43-
4437
pub fn is_user_range(p: *const u8, len: usize) -> bool {
4538
let start=p as u64;
4639
let end=start + (len as u64);

src/libstd/sys/sgx/abi/usercalls/mod.rs

-8
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ pub fn read(fd: Fd, buf: &mut [u8]) -> IoResult<usize> {
3333
}
3434
}
3535

36-
pub fn read_alloc(fd: Fd) -> IoResult<Vec<u8>> {
37-
unsafe {
38-
let mut userbuf = alloc::User::<ByteBuffer>::uninitialized();
39-
raw::read_alloc(fd, userbuf.as_raw_mut_ptr()).from_sgx_result()?;
40-
Ok(copy_user_buffer(&userbuf))
41-
}
42-
}
43-
4436
pub fn write(fd: Fd, buf: &[u8]) -> IoResult<usize> {
4537
unsafe {
4638
let userbuf = alloc::User::new_from_enclave(buf);

src/libstd/sys/sgx/condvar.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub struct Condvar {
1818
}
1919

2020
impl Condvar {
21-
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
2221
pub const fn new() -> Condvar {
2322
Condvar { inner: SpinMutex::new(WaitVariable::new(())) }
2423
}

src/libstd/sys/sgx/mutex.rs

-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub struct Mutex {
2020

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

8180
impl ReentrantMutex {
82-
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
8381
pub const fn uninitialized() -> ReentrantMutex {
8482
ReentrantMutex {
8583
inner: SpinMutex::new(WaitVariable::new(ReentrantLock { owner: None, count: 0 }))

src/libstd/sys/sgx/rwlock.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ pub struct RWLock {
2121
//unsafe impl Sync for RWLock {} // FIXME
2222

2323
impl RWLock {
24-
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
2524
pub const fn new() -> RWLock {
2625
RWLock {
2726
readers: SpinMutex::new(WaitVariable::new(None)),

src/libstd/sys/sgx/waitqueue.rs

-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ pub struct WaitVariable<T> {
5050
}
5151

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

139138
impl WaitQueue {
140-
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
141139
pub const fn new() -> Self {
142140
WaitQueue {
143141
inner: UnsafeList::new()
@@ -255,7 +253,6 @@ mod unsafe_list {
255253
}
256254

257255
impl<T> UnsafeList<T> {
258-
#[unstable(feature = "sgx_internals", issue = "0")] // FIXME: min_const_fn
259256
pub const fn new() -> Self {
260257
unsafe {
261258
UnsafeList {

src/libstd/sys_common/condvar.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ impl Condvar {
2525
///
2626
/// Behavior is undefined if the condition variable is moved after it is
2727
/// first used with any of the functions below.
28-
#[unstable(feature = "sys_internals", issue = "0")] // FIXME: min_const_fn
2928
pub const fn new() -> Condvar { Condvar(imp::Condvar::new()) }
3029

3130
/// Prepares the condition variable for use.

src/libstd/sys_common/mutex.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ impl Mutex {
2727
/// Also, until `init` is called, behavior is undefined if this
2828
/// mutex is ever used reentrantly, i.e., `raw_lock` or `try_lock`
2929
/// are called by the thread currently holding the lock.
30-
#[unstable(feature = "sys_internals", issue = "0")] // FIXME: min_const_fn
3130
pub const fn new() -> Mutex { Mutex(imp::Mutex::new()) }
3231

3332
/// Prepare the mutex for use.

src/libstd/sys_common/rwlock.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ impl RWLock {
2222
///
2323
/// Behavior is undefined if the reader-writer lock is moved after it is
2424
/// first used with any of the functions below.
25-
#[unstable(feature = "sys_internals", issue = "0")] // FIXME: min_const_fn
2625
pub const fn new() -> RWLock { RWLock(imp::RWLock::new()) }
2726

2827
/// Acquires shared access to the underlying lock, blocking the current

0 commit comments

Comments
 (0)