From 270f0eef733a625bcee68019189f19dc119f8f24 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Tue, 17 Feb 2015 21:41:32 +0100 Subject: Add `: Box<_>` or `::Box<_>` type annotations to various places. This is the kind of change that one is expected to need to make to accommodate overloaded-`box`. ---- Note that this is not *all* of the changes necessary to accommodate Issue 22181. It is merely the subset of those cases where there was already a let-binding in place that made it easy to add the necesasry type ascription. (For unnamed intermediate `Box` values, one must go down a different route; `Box::new` is the option that maximizes portability, but has potential inefficiency depending on whether the call is inlined.) ---- There is one place worth note, `run-pass/coerce-match.rs`, where I used an ugly form of `Box<_>` type ascription where I would have preferred to use `Box::new` to accommodate overloaded-`box`. I deliberately did not use `Box::new` here, because that is already done in coerce-match-calls.rs. ---- Precursor for overloaded-`box` and placement-`in`; see Issue 22181. --- src/libstd/thread.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstd/thread.rs') diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index e8330820906..9be77e78ed1 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -804,7 +804,7 @@ mod test { fn avoid_copying_the_body(spawnfn: F) where F: FnOnce(Thunk<'static>) { let (tx, rx) = channel(); - let x = box 1; + let x: Box<_> = box 1; let x_in_parent = (&*x) as *const i32 as usize; spawnfn(Thunk::new(move|| { -- cgit 1.4.1-3-g733a5