diff options
| author | bors <bors@rust-lang.org> | 2019-04-13 22:24:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-04-13 22:24:33 +0000 |
| commit | 00856722bad5e9d96048319fb41f4b7e249820cd (patch) | |
| tree | 9c813b5a9ac58b59d765a510e2f03c84446b6962 /src/libstd/sys_common | |
| parent | e4c66afba5d69356879570aeff22db5a38566a86 (diff) | |
| parent | cf370b40dc9955ed3cff90f94b96507513ad6ded (diff) | |
| download | rust-00856722bad5e9d96048319fb41f4b7e249820cd.tar.gz rust-00856722bad5e9d96048319fb41f4b7e249820cd.zip | |
Auto merge of #59949 - Centril:rollup-lsiqq1g, r=Centril
Rollup of 16 pull requests
Successful merges:
- #59675 (Stabilize the `alloc` crate.)
- #59708 (Mark variables captured by reference as mutable correctly)
- #59735 (remove lookup_char_pos_adj)
- #59747 (Copy book.toml unstable book generator)
- #59796 (Retire `IsNotConst` naming)
- #59804 (Clean up jobserver integration)
- #59818 (Eliminate `FnBox` usages from libstd.)
- #59830 (Fix links on keyword docs.)
- #59835 (Re-export NonZero signed variant in std)
- #59852 (std: Add `{read,write}_vectored` for more types)
- #59855 (Fix attributes position in type declaration)
- #59858 (Make duplicate matcher bindings a hard error)
- #59899 (In `-Zprint-type-size` output, sort enum variants by size.)
- #59912 (MaybeUninit: remove deprecated functions)
- #59925 (Fix paste error in split_ascii_whitespace docs.)
- #59930 (Exclude some copies of old book editions from search engines)
Failed merges:
r? @ghost
Diffstat (limited to 'src/libstd/sys_common')
| -rw-r--r-- | src/libstd/sys_common/at_exit_imp.rs | 5 | ||||
| -rw-r--r-- | src/libstd/sys_common/thread.rs | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/src/libstd/sys_common/at_exit_imp.rs b/src/libstd/sys_common/at_exit_imp.rs index 1181b861611..cdb72ee872e 100644 --- a/src/libstd/sys_common/at_exit_imp.rs +++ b/src/libstd/sys_common/at_exit_imp.rs @@ -2,12 +2,11 @@ //! //! Documentation can be found on the `rt::at_exit` function. -use crate::boxed::FnBox; use crate::ptr; use crate::mem; use crate::sys_common::mutex::Mutex; -type Queue = Vec<Box<dyn FnBox()>>; +type Queue = Vec<Box<dyn FnOnce()>>; // NB these are specifically not types from `std::sync` as they currently rely // on poisoning and this module needs to operate at a lower level than requiring @@ -61,7 +60,7 @@ pub fn cleanup() { } } -pub fn push(f: Box<dyn FnBox()>) -> bool { +pub fn push(f: Box<dyn FnOnce()>) -> bool { unsafe { let _guard = LOCK.lock(); if init() { diff --git a/src/libstd/sys_common/thread.rs b/src/libstd/sys_common/thread.rs index b2142e75308..6ab0d5cbe9c 100644 --- a/src/libstd/sys_common/thread.rs +++ b/src/libstd/sys_common/thread.rs @@ -1,4 +1,3 @@ -use crate::boxed::FnBox; use crate::env; use crate::sync::atomic::{self, Ordering}; use crate::sys::stack_overflow; @@ -11,7 +10,7 @@ pub unsafe fn start_thread(main: *mut u8) { let _handler = stack_overflow::Handler::new(); // Finally, let's run some code. - Box::from_raw(main as *mut Box<dyn FnBox()>)() + Box::from_raw(main as *mut Box<dyn FnOnce()>)() } pub fn min_stack() -> usize { |
