diff options
| author | CrLF0710 <crlf0710@gmail.com> | 2019-04-10 00:46:28 +0800 | 
|---|---|---|
| committer | CrLF0710 <crlf0710@gmail.com> | 2019-04-10 09:40:44 +0800 | 
| commit | 6635fbed4ca8c65822f99e994735bd1877fb063e (patch) | |
| tree | b025f0af7d69a1aa1713e81fbece7dfad30c1b3a /src/libstd/sys_common/at_exit_imp.rs | |
| parent | 3750348daff89741e3153e0e120aa70a45ff5b68 (diff) | |
| download | rust-6635fbed4ca8c65822f99e994735bd1877fb063e.tar.gz rust-6635fbed4ca8c65822f99e994735bd1877fb063e.zip | |
Eliminate `FnBox` usages from libstd.
Diffstat (limited to 'src/libstd/sys_common/at_exit_imp.rs')
| -rw-r--r-- | src/libstd/sys_common/at_exit_imp.rs | 5 | 
1 files changed, 2 insertions, 3 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() { | 
