Skip to content

Commit 9584f50

Browse files
committed
---
yaml --- r: 169215 b: refs/heads/snap-stage3 c: 3fd6bfa h: refs/heads/master i: 169213: 177cf3e 169211: 19f6de8 169207: ad0866b 169199: 57a0d52 169183: 9858733 169151: ef63e03 169087: ca68cd7 168959: 7798d19 v: v3
1 parent e847919 commit 9584f50

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 5e21e17d9638d14af41e27e5ca9a21c8a1bc0170
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: b57b0e0f3a49a81c23f7af6cbd72a67fdf6b9574
4+
refs/heads/snap-stage3: 3fd6bfa8f7a1d193316956b5be8818c47bb874b7
55
refs/heads/try: 5204084bd2e46af7cc6e0147430e44dd0d657bbb
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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)