about summary refs log tree commit diff
path: root/src/test/run-make/save-analysis
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-15 09:52:21 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-03-03 21:05:55 +0100
commit0d5bcb14adb71900a99f06b92485de7e019734c2 (patch)
tree37b9faace62c6658ff6ecf9d646e04c01be875fb /src/test/run-make/save-analysis
parentb03279aaa2b20f6033e66fc7aea29c0b43e71082 (diff)
downloadrust-0d5bcb14adb71900a99f06b92485de7e019734c2.tar.gz
rust-0d5bcb14adb71900a99f06b92485de7e019734c2.zip
Switched to Box::new in many places.
Many of the modifications putting in `Box::new` calls also include a
pointer to Issue 22405, which tracks going back to `box <expr>` if
possible in the future.

(Still tried to use `Box<_>` where it sufficed; thus some tests still
have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.)

Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
Diffstat (limited to 'src/test/run-make/save-analysis')
-rw-r--r--src/test/run-make/save-analysis/foo.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/run-make/save-analysis/foo.rs b/src/test/run-make/save-analysis/foo.rs
index 38381da3670..7d94f4c7b17 100644
--- a/src/test/run-make/save-analysis/foo.rs
+++ b/src/test/run-make/save-analysis/foo.rs
@@ -245,9 +245,10 @@ fn hello<X: SomeTrait>((z, a) : (u32, String), ex: X) {
     let x = 32.0f32;
     let _ = (x + ((x * x) + 1.0).sqrt()).ln();
 
-    let s: Box<SomeTrait> = box some_fields {field1: 43};
+    // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
+    let s: Box<SomeTrait> = Box::new(some_fields {field1: 43});
     let s2: Box<some_fields> =  box some_fields {field1: 43};
-    let s3 = box nofields;
+    let s3: Box<_> = box nofields;
 
     s.Method(43);
     s3.Method(43);
@@ -282,7 +283,7 @@ pub struct blah {
 }
 
 fn main() { // foo
-    let s = box some_fields {field1: 43};
+    let s: Box<_> = box some_fields {field1: 43};
     hello((43, "a".to_string()), *s);
     sub::sub2::hello();
     sub2::sub3::hello();