Skip to content

Commit 7995cb1

Browse files
committed
---
yaml --- r: 171095 b: refs/heads/try c: 3fd6bfa h: refs/heads/master i: 171093: bc756c3 171091: 81ea757 171087: 13f03ec v: v3
1 parent cf79c34 commit 7995cb1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 73a25f55ad748b4d3516417c711b99ce446591af
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 5b3cd3900ceda838f5798c30ab96ceb41f962534
5-
refs/heads/try: b57b0e0f3a49a81c23f7af6cbd72a67fdf6b9574
5+
refs/heads/try: 3fd6bfa8f7a1d193316956b5be8818c47bb874b7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/liballoc/boxed.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -186,36 +186,36 @@ impl<T: ?Sized> DerefMut for Box<T> {
186186
mod test {
187187
#[test]
188188
fn test_owned_clone() {
189-
let a = box 5i;
189+
let a = Box::new(5i);
190190
let b: Box<int> = a.clone();
191191
assert!(a == b);
192192
}
193193

194194
#[test]
195195
fn any_move() {
196-
let a = box 8u as Box<Any>;
197-
let b = box Test as Box<Any>;
196+
let a = Box::new(8u) as Box<Any>;
197+
let b = Box::new(Test) as Box<Any>;
198198

199199
match a.downcast::<uint>() {
200-
Ok(a) => { assert!(a == box 8u); }
200+
Ok(a) => { assert!(a == Box::new(8u)); }
201201
Err(..) => panic!()
202202
}
203203
match b.downcast::<Test>() {
204-
Ok(a) => { assert!(a == box Test); }
204+
Ok(a) => { assert!(a == Box::new(Test)); }
205205
Err(..) => panic!()
206206
}
207207

208-
let a = box 8u as Box<Any>;
209-
let b = box Test as Box<Any>;
208+
let a = Box::new(8u) as Box<Any>;
209+
let b = Box::new(Test) as Box<Any>;
210210

211211
assert!(a.downcast::<Box<Test>>().is_err());
212212
assert!(b.downcast::<Box<uint>>().is_err());
213213
}
214214

215215
#[test]
216216
fn test_show() {
217-
let a = box 8u as Box<Any>;
218-
let b = box Test as Box<Any>;
217+
let a = Box::new(8u) as Box<Any>;
218+
let b = Box::new(Test) as Box<Any>;
219219
let a_str = a.to_str();
220220
let b_str = b.to_str();
221221
assert_eq!(a_str, "Box<Any>");
@@ -232,6 +232,6 @@ mod test {
232232
#[test]
233233
fn deref() {
234234
fn homura<T: Deref<Target=i32>>(_: T) { }
235-
homura(box 765i32);
235+
homura(Box::new(765i32));
236236
}
237237
}

0 commit comments

Comments
 (0)