@@ -32,7 +32,7 @@ fn test_simple_clone() {
32
32
33
33
#[ test]
34
34
fn test_destructor ( ) {
35
- let x: Rc < Box < _ > > = Rc :: new ( box 5 ) ;
35
+ let x: Rc < Box < _ > > = Rc :: new ( Box :: new ( 5 ) ) ;
36
36
assert_eq ! ( * * x, 5 ) ;
37
37
}
38
38
@@ -153,7 +153,7 @@ fn try_unwrap() {
153
153
154
154
#[ test]
155
155
fn into_from_raw ( ) {
156
- let x = Rc :: new ( box "hello" ) ;
156
+ let x = Rc :: new ( Box :: new ( "hello" ) ) ;
157
157
let y = x. clone ( ) ;
158
158
159
159
let x_ptr = Rc :: into_raw ( x) ;
@@ -192,7 +192,7 @@ fn test_into_from_raw_unsized() {
192
192
193
193
#[ test]
194
194
fn into_from_weak_raw ( ) {
195
- let x = Rc :: new ( box "hello" ) ;
195
+ let x = Rc :: new ( Box :: new ( "hello" ) ) ;
196
196
let y = Rc :: downgrade ( & x) ;
197
197
198
198
let y_ptr = Weak :: into_raw ( y) ;
@@ -409,7 +409,7 @@ fn test_clone_from_slice_panic() {
409
409
410
410
#[ test]
411
411
fn test_from_box ( ) {
412
- let b: Box < u32 > = box 123 ;
412
+ let b: Box < u32 > = Box :: new ( 123 ) ;
413
413
let r: Rc < u32 > = Rc :: from ( b) ;
414
414
415
415
assert_eq ! ( * r, 123 ) ;
@@ -438,7 +438,7 @@ fn test_from_box_trait() {
438
438
use std:: fmt:: Display ;
439
439
use std:: string:: ToString ;
440
440
441
- let b: Box < dyn Display > = box 123 ;
441
+ let b: Box < dyn Display > = Box :: new ( 123 ) ;
442
442
let r: Rc < dyn Display > = Rc :: from ( b) ;
443
443
444
444
assert_eq ! ( r. to_string( ) , "123" ) ;
@@ -448,7 +448,7 @@ fn test_from_box_trait() {
448
448
fn test_from_box_trait_zero_sized ( ) {
449
449
use std:: fmt:: Debug ;
450
450
451
- let b: Box < dyn Debug > = box ( ) ;
451
+ let b: Box < dyn Debug > = Box :: new ( ( ) ) ;
452
452
let r: Rc < dyn Debug > = Rc :: from ( b) ;
453
453
454
454
assert_eq ! ( format!( "{r:?}" ) , "()" ) ;
0 commit comments