diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-04-14 00:23:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-04-14 00:23:35 +0200 |
| commit | 8ad17ec6e42a2f72853d45b009569a7aaa5cab03 (patch) | |
| tree | 9edbc6d47ebfaf1da37f1747b00e05f15a84ff94 /src/libstd/sys/sgx | |
| parent | 1888b55d7b6f18e9707ff9d1a72e48905f7bfde2 (diff) | |
| parent | 6635fbed4ca8c65822f99e994735bd1877fb063e (diff) | |
| download | rust-8ad17ec6e42a2f72853d45b009569a7aaa5cab03.tar.gz rust-8ad17ec6e42a2f72853d45b009569a7aaa5cab03.zip | |
Rollup merge of #59818 - crlf0710:eliminate_libstd_fnbox, r=cramertj
Eliminate `FnBox` usages from libstd.
Diffstat (limited to 'src/libstd/sys/sgx')
| -rw-r--r-- | src/libstd/sys/sgx/thread.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libstd/sys/sgx/thread.rs b/src/libstd/sys/sgx/thread.rs index 565a523ebe0..b9f42d4ad1c 100644 --- a/src/libstd/sys/sgx/thread.rs +++ b/src/libstd/sys/sgx/thread.rs @@ -1,5 +1,4 @@ #![cfg_attr(test, allow(dead_code))] // why is this necessary? -use crate::boxed::FnBox; use crate::ffi::CStr; use crate::io; use crate::time::Duration; @@ -13,17 +12,16 @@ pub const DEFAULT_MIN_STACK_SIZE: usize = 4096; mod task_queue { use crate::sync::{Mutex, MutexGuard, Once}; use crate::sync::mpsc; - use crate::boxed::FnBox; pub type JoinHandle = mpsc::Receiver<()>; pub(super) struct Task { - p: Box<dyn FnBox()>, + p: Box<dyn FnOnce()>, done: mpsc::Sender<()>, } impl Task { - pub(super) fn new(p: Box<dyn FnBox()>) -> (Task, JoinHandle) { + pub(super) fn new(p: Box<dyn FnOnce()>) -> (Task, JoinHandle) { let (done, recv) = mpsc::channel(); (Task { p, done }, recv) } @@ -51,7 +49,7 @@ mod task_queue { impl Thread { // unsafe: see thread::Builder::spawn_unchecked for safety requirements - pub unsafe fn new(_stack: usize, p: Box<dyn FnBox()>) + pub unsafe fn new(_stack: usize, p: Box<dyn FnOnce()>) -> io::Result<Thread> { let mut queue_lock = task_queue::lock(); |
