]> git.lizzy.rs Git - rust.git/blobdiff - src/test/compile-fail/fat-ptr-cast.rs
fix conflicts
[rust.git] / src / test / compile-fail / fat-ptr-cast.rs
index f6633547a7b5b6f20e5a8b53d41df2f84ba953a2..25cab09b7cb497ff59f9b933ecb13b69e2b53a53 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+trait Trait {}
+
 // Make sure casts between thin-pointer <-> fat pointer obey RFC401
 fn main() {
     let a: &[i32] = &[1, 2, 3];
@@ -17,7 +19,7 @@ fn main() {
 
     a as usize; //~ ERROR illegal cast
     b as usize; //~ ERROR non-scalar cast
-    p as usize; //~ ERROR illegal cast
+    p as usize; //~ ERROR illegal cast; cast through a raw pointer
 
     // #22955
     q as *const [i32]; //~ ERROR illegal cast