@@ -32,7 +32,7 @@ fn test_simple_clone() {
3232
3333#[ test]
3434fn test_destructor ( ) {
35- let x: Rc < Box < _ > > = Rc :: new ( box 5 ) ;
35+ let x: Rc < Box < _ > > = Rc :: new ( Box :: new ( 5 ) ) ;
3636 assert_eq ! ( * * x, 5 ) ;
3737}
3838
@@ -153,7 +153,7 @@ fn try_unwrap() {
153153
154154#[ test]
155155fn into_from_raw ( ) {
156- let x = Rc :: new ( box "hello" ) ;
156+ let x = Rc :: new ( Box :: new ( "hello" ) ) ;
157157 let y = x. clone ( ) ;
158158
159159 let x_ptr = Rc :: into_raw ( x) ;
@@ -192,7 +192,7 @@ fn test_into_from_raw_unsized() {
192192
193193#[ test]
194194fn into_from_weak_raw ( ) {
195- let x = Rc :: new ( box "hello" ) ;
195+ let x = Rc :: new ( Box :: new ( "hello" ) ) ;
196196 let y = Rc :: downgrade ( & x) ;
197197
198198 let y_ptr = Weak :: into_raw ( y) ;
@@ -409,7 +409,7 @@ fn test_clone_from_slice_panic() {
409409
410410#[ test]
411411fn test_from_box ( ) {
412- let b: Box < u32 > = box 123 ;
412+ let b: Box < u32 > = Box :: new ( 123 ) ;
413413 let r: Rc < u32 > = Rc :: from ( b) ;
414414
415415 assert_eq ! ( * r, 123 ) ;
@@ -438,7 +438,7 @@ fn test_from_box_trait() {
438438 use std:: fmt:: Display ;
439439 use std:: string:: ToString ;
440440
441- let b: Box < dyn Display > = box 123 ;
441+ let b: Box < dyn Display > = Box :: new ( 123 ) ;
442442 let r: Rc < dyn Display > = Rc :: from ( b) ;
443443
444444 assert_eq ! ( r. to_string( ) , "123" ) ;
@@ -448,7 +448,7 @@ fn test_from_box_trait() {
448448fn test_from_box_trait_zero_sized ( ) {
449449 use std:: fmt:: Debug ;
450450
451- let b: Box < dyn Debug > = box ( ) ;
451+ let b: Box < dyn Debug > = Box :: new ( ( ) ) ;
452452 let r: Rc < dyn Debug > = Rc :: from ( b) ;
453453
454454 assert_eq ! ( format!( "{r:?}" ) , "()" ) ;
0 commit comments