diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2015-04-01 11:12:30 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2015-04-01 14:41:21 -0400 |
| commit | cade32acf6f5ff209ee082d70350d9bc0362985a (patch) | |
| tree | 79c4fd475c0b8e9f75972eb505800399025fba06 /src/libstd/sys | |
| parent | ed63d32651105e56afceb94cbb86f115db235825 (diff) | |
| download | rust-cade32acf6f5ff209ee082d70350d9bc0362985a.tar.gz rust-cade32acf6f5ff209ee082d70350d9bc0362985a.zip | |
Remove `Thunk` struct and `Invoke` trait; change `Thunk` to be an alias
for `Box<FnBox()>`. I found the alias was still handy because it is shorter than the fully written type. This is a [breaking-change]: convert code using `Invoke` to use `FnBox`, which is usually pretty straight-forward. Code using thunk mostly works if you change `Thunk::new => Box::new` and `foo.invoke(arg)` to `foo(arg)`.
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/common/thread.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstd/sys/common/thread.rs b/src/libstd/sys/common/thread.rs index f45daea18a2..1845b6266ed 100644 --- a/src/libstd/sys/common/thread.rs +++ b/src/libstd/sys/common/thread.rs @@ -25,6 +25,7 @@ pub fn start_thread(main: *mut libc::c_void) { unsafe { stack::record_os_managed_stack_bounds(0, usize::MAX); let _handler = stack_overflow::Handler::new(); - Box::from_raw(main as *mut Thunk).invoke(()); + let main: Box<Thunk> = Box::from_raw(main as *mut Thunk); + main(); } } |
