]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/destructure-trait-ref.rs
Merge commit 'a8385522ade6f67853edac730b5bf164ddb298fd' into simd-remove-autosplats
[rust.git] / src / test / ui / destructure-trait-ref.rs
index fdc9bbab7306773b2a91190989c4c3092c336adc..50b64aeebf0efadb3904a9b10e10b250d580c7c3 100644 (file)
@@ -2,11 +2,11 @@
 // reference work properly.
 
 #![feature(box_patterns)]
-#![feature(box_syntax)]
 
 trait T { fn foo(&self) {} }
 impl T for isize {}
 
+
 fn main() {
     // For an expression of the form:
     //
@@ -25,7 +25,7 @@ fn main() {
     // n == m
     let &x = &1isize as &dyn T;      //~ ERROR type `&dyn T` cannot be dereferenced
     let &&x = &(&1isize as &dyn T);  //~ ERROR type `&dyn T` cannot be dereferenced
-    let box x = box 1isize as Box<dyn T>;
+    let box x = Box::new(1isize) as Box<dyn T>;
     //~^ ERROR type `Box<dyn T>` cannot be dereferenced
 
     // n > m
@@ -37,7 +37,7 @@ fn main() {
     //~^ ERROR mismatched types
     //~| expected trait object `dyn T`
     //~| found reference `&_`
-    let box box x = box 1isize as Box<dyn T>;
+    let box box x = Box::new(1isize) as Box<dyn T>;
     //~^ ERROR mismatched types
     //~| expected trait object `dyn T`
     //~| found struct `Box<_>`