File tree Expand file tree Collapse file tree 6 files changed +6
-6
lines changed Expand file tree Collapse file tree 6 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ fn test_transmute() {
9595 trait Foo { fn dummy ( & self ) { } }
9696 impl Foo for isize { }
9797
98- let a = box 100isize as Box < Foo > ;
98+ let a = Box :: new ( 100isize ) as Box < Foo > ;
9999 unsafe {
100100 let x: :: core:: raw:: TraitObject = transmute ( a) ;
101101 assert ! ( * ( x. data as * const isize ) == 100 ) ;
Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ fn test_collect() {
234234
235235 // test that it does not take more elements than it needs
236236 let mut functions: [ Box < Fn ( ) -> Option < ( ) > > ; 3 ] =
237- [ box || Some ( ( ) ) , box || None , box || panic ! ( ) ] ;
237+ [ Box :: new ( || Some ( ( ) ) ) , Box :: new ( || None ) , Box :: new ( || panic ! ( ) ) ] ;
238238
239239 let v: Option < Vec < ( ) > > = functions. iter_mut ( ) . map ( |f| ( * f) ( ) ) . collect ( ) ;
240240
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ fn test_collect() {
8080
8181 // test that it does not take more elements than it needs
8282 let mut functions: [ Box < Fn ( ) -> Result < ( ) , isize > > ; 3 ] =
83- [ box || Ok ( ( ) ) , box || Err ( 1 ) , box || panic ! ( ) ] ;
83+ [ Box :: new ( || Ok ( ( ) ) ) , Box :: new ( || Err ( 1 ) ) , Box :: new ( || panic ! ( ) ) ] ;
8484
8585 let v: Result < Vec < ( ) > , isize > = functions. iter_mut ( ) . map ( |f| ( * f) ( ) ) . collect ( ) ;
8686 assert ! ( v == Err ( 1 ) ) ;
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ impl Emitter for ExpectErrorEmitter {
9292
9393fn errors ( msgs : & [ & str ] ) -> ( Box < Emitter +Send > , usize ) {
9494 let v = msgs. iter ( ) . map ( |m| m. to_string ( ) ) . collect ( ) ;
95- ( box ExpectErrorEmitter { messages : v } as Box < Emitter +Send > , msgs. len ( ) )
95+ ( Box :: new ( ExpectErrorEmitter { messages : v } ) as Box < Emitter +Send > , msgs. len ( ) )
9696}
9797
9898fn test_env < F > ( source_string : & str ,
Original file line number Diff line number Diff line change @@ -967,7 +967,7 @@ mod tests {
967967 #[ test]
968968 fn test_try_panic_message_any ( ) {
969969 match thread:: spawn ( move || {
970- panic ! ( box 413u16 as Box <Any + Send >) ;
970+ panic ! ( Box :: new ( 413u16 ) as Box <Any + Send >) ;
971971 } ) . join ( ) {
972972 Err ( e) => {
973973 type T = Box < Any + Send > ;
Original file line number Diff line number Diff line change @@ -33,5 +33,5 @@ impl Trait for Struct {}
3333fn main ( ) {
3434 let stack_struct = Struct { a : 0 , b : 1.0 } ;
3535 let reference: & Trait = & stack_struct as & Trait ;
36- let unique: Box < Trait > = box Struct { a : 2 , b : 3.0 } as Box < Trait > ;
36+ let unique: Box < Trait > = Box :: new ( Struct { a : 2 , b : 3.0 } ) as Box < Trait > ;
3737}
You can’t perform that action at this time.
0 commit comments