@@ -186,36 +186,36 @@ impl<T: ?Sized> DerefMut for Box<T> {
186
186
mod test {
187
187
#[ test]
188
188
fn test_owned_clone ( ) {
189
- let a = box 5 i ;
189
+ let a = Box :: new ( 5 i ) ;
190
190
let b: Box < int > = a. clone ( ) ;
191
191
assert ! ( a == b) ;
192
192
}
193
193
194
194
#[ test]
195
195
fn any_move ( ) {
196
- let a = box 8 u as Box < Any > ;
197
- let b = box Test as Box < Any > ;
196
+ let a = Box :: new ( 8 u ) as Box < Any > ;
197
+ let b = Box :: new ( Test ) as Box < Any > ;
198
198
199
199
match a. downcast :: < uint > ( ) {
200
- Ok ( a) => { assert ! ( a == box 8 u ) ; }
200
+ Ok ( a) => { assert ! ( a == Box :: new ( 8 u ) ) ; }
201
201
Err ( ..) => panic ! ( )
202
202
}
203
203
match b. downcast :: < Test > ( ) {
204
- Ok ( a) => { assert ! ( a == box Test ) ; }
204
+ Ok ( a) => { assert ! ( a == Box :: new ( Test ) ) ; }
205
205
Err ( ..) => panic ! ( )
206
206
}
207
207
208
- let a = box 8 u as Box < Any > ;
209
- let b = box Test as Box < Any > ;
208
+ let a = Box :: new ( 8 u ) as Box < Any > ;
209
+ let b = Box :: new ( Test ) as Box < Any > ;
210
210
211
211
assert ! ( a. downcast:: <Box <Test >>( ) . is_err( ) ) ;
212
212
assert ! ( b. downcast:: <Box <uint>>( ) . is_err( ) ) ;
213
213
}
214
214
215
215
#[ test]
216
216
fn test_show ( ) {
217
- let a = box 8 u as Box < Any > ;
218
- let b = box Test as Box < Any > ;
217
+ let a = Box :: new ( 8 u ) as Box < Any > ;
218
+ let b = Box :: new ( Test ) as Box < Any > ;
219
219
let a_str = a. to_str ( ) ;
220
220
let b_str = b. to_str ( ) ;
221
221
assert_eq ! ( a_str, "Box<Any>" ) ;
@@ -232,6 +232,6 @@ mod test {
232
232
#[ test]
233
233
fn deref ( ) {
234
234
fn homura < T : Deref < Target =i32 > > ( _: T ) { }
235
- homura ( box 765i32 ) ;
235
+ homura ( Box :: new ( 765i32 ) ) ;
236
236
}
237
237
}
0 commit comments