diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2014-12-30 18:05:17 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2014-12-31 22:50:25 -0500 |
| commit | 371f04d4330f70cfab5fa2a5fdb65df7ccd0604c (patch) | |
| tree | 501d58736b4db70155b452b58d39fc658721ef6f /src/libstd/sys/common | |
| parent | a17c2b60e1c32e950b011296025a9f88f4d3c4e4 (diff) | |
| download | rust-371f04d4330f70cfab5fa2a5fdb65df7ccd0604c.tar.gz rust-371f04d4330f70cfab5fa2a5fdb65df7ccd0604c.zip | |
std: unbox closures used in function arguments
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/thread_info.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/common/thread_info.rs b/src/libstd/sys/common/thread_info.rs index dc21feb17a8..8c76eb1504d 100644 --- a/src/libstd/sys/common/thread_info.rs +++ b/src/libstd/sys/common/thread_info.rs @@ -26,13 +26,13 @@ struct ThreadInfo { thread_local! { static THREAD_INFO: RefCell<Option<ThreadInfo>> = RefCell::new(None) } impl ThreadInfo { - fn with<R>(f: |&mut ThreadInfo| -> R) -> R { + fn with<R, F>(f: F) -> R where F: FnOnce(&mut ThreadInfo) -> R { if THREAD_INFO.destroyed() { panic!("Use of std::thread::Thread::current() is not possible after \ the thread's local data has been destroyed"); } - THREAD_INFO.with(|c| { + THREAD_INFO.with(move |c| { if c.borrow().is_none() { *c.borrow_mut() = Some(ThreadInfo { stack_bounds: (0, 0), |
