diff options
| author | bors <bors@rust-lang.org> | 2015-03-03 20:17:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-03 20:17:08 +0000 |
| commit | fed12499e7d91f9cdfba5833e34d20e8fd19b898 (patch) | |
| tree | 2c5b377f6a53498f2555965e4903b77e4c8aad30 /src/libstd/old_io/timer.rs | |
| parent | 129173f1980e9ac03f7ef0fc0193c41235d07649 (diff) | |
| parent | cb1b0dd589c80c3edb94b8982ea33e000978f572 (diff) | |
| download | rust-fed12499e7d91f9cdfba5833e34d20e8fd19b898.tar.gz rust-fed12499e7d91f9cdfba5833e34d20e8fd19b898.zip | |
Auto merge of #23002 - pnkfelix:fsk-box-place-runway, r=nikomatsakis
Runway for RFC 809 (overloaded box/placement-in) by adding type annotations or explicit calls to `Box::new` where I found it necessary on PR #22086. I have broken this up into more than one PR because the entire commit chain (see PR #22086) is long, widespread and unwieldy to rebase frequently. To my knowledge this is not a breaking change. Also, there is in principle nothing stopping someone from reverting some/all of these annotations, since without the rest of the commit chain in #22086, the associated code would continue to compile. All I can do is ask: Try to discourage others from removing seemingly "unnecessary" uses of the `Box` type or the `Box::new()` function, until the rest of RFC 809 lands.
Diffstat (limited to 'src/libstd/old_io/timer.rs')
| -rw-r--r-- | src/libstd/old_io/timer.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstd/old_io/timer.rs b/src/libstd/old_io/timer.rs index 1f2ef50fcae..de5f2141095 100644 --- a/src/libstd/old_io/timer.rs +++ b/src/libstd/old_io/timer.rs @@ -15,6 +15,7 @@ // FIXME: These functions take Durations but only pass ms to the backend impls. +use boxed::Box; use sync::mpsc::{Receiver, Sender, channel}; use time::Duration; use old_io::IoResult; @@ -143,7 +144,7 @@ impl Timer { let (tx, rx) = channel(); // Short-circuit the timer backend for 0 duration if in_ms_u64(duration) != 0 { - self.inner.oneshot(in_ms_u64(duration), box TimerCallback { tx: tx }); + self.inner.oneshot(in_ms_u64(duration), Box::new(TimerCallback { tx: tx })); } else { tx.send(()).unwrap(); } @@ -204,7 +205,7 @@ impl Timer { // not clear what use a 0ms period is anyway... let ms = if ms == 0 { 1 } else { ms }; let (tx, rx) = channel(); - self.inner.period(ms, box TimerCallback { tx: tx }); + self.inner.period(ms, Box::new(TimerCallback { tx: tx })); return rx } } |
