2017-12-10 13:47:55 -06:00
|
|
|
error[E0606]: casting `&[i32]` as `usize` is invalid
|
|
|
|
--> $DIR/fat-ptr-cast.rs:20:5
|
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | a as usize; //~ ERROR casting
|
2017-12-10 13:47:55 -06:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: cast through a raw pointer first
|
|
|
|
|
|
|
|
error[E0606]: casting `&[i32]` as `isize` is invalid
|
2017-12-10 14:29:24 -06:00
|
|
|
--> $DIR/fat-ptr-cast.rs:21:5
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | a as isize; //~ ERROR casting
|
2017-12-10 13:47:55 -06:00
|
|
|
| ^^^^^^^^^^
|
2018-01-03 18:14:53 -06:00
|
|
|
|
|
|
|
|
= help: cast through a raw pointer first
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
|
|
error[E0606]: casting `&[i32]` as `i16` is invalid
|
2017-12-10 14:29:24 -06:00
|
|
|
--> $DIR/fat-ptr-cast.rs:22:5
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | a as i16; //~ ERROR casting `&[i32]` as `i16` is invalid
|
2017-12-10 13:47:55 -06:00
|
|
|
| ^^^^^^^^
|
2018-01-03 18:14:53 -06:00
|
|
|
|
|
|
|
|
= help: cast through a raw pointer first
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
|
|
error[E0606]: casting `&[i32]` as `u32` is invalid
|
2017-12-10 14:29:24 -06:00
|
|
|
--> $DIR/fat-ptr-cast.rs:23:5
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | a as u32; //~ ERROR casting `&[i32]` as `u32` is invalid
|
2017-12-10 13:47:55 -06:00
|
|
|
| ^^^^^^^^
|
2018-01-03 18:14:53 -06:00
|
|
|
|
|
|
|
|
= help: cast through a raw pointer first
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
|
|
error[E0605]: non-primitive cast: `std::boxed::Box<[i32]>` as `usize`
|
2017-12-10 14:29:24 -06:00
|
|
|
--> $DIR/fat-ptr-cast.rs:24:5
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | b as usize; //~ ERROR non-primitive cast
|
2017-12-10 13:47:55 -06:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait
|
|
|
|
|
|
|
|
error[E0606]: casting `*const [i32]` as `usize` is invalid
|
2017-12-10 14:29:24 -06:00
|
|
|
--> $DIR/fat-ptr-cast.rs:25:5
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | p as usize;
|
2017-12-10 13:47:55 -06:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
|
|
|
= help: cast through a thin pointer first
|
|
|
|
|
|
|
|
error[E0607]: cannot cast thin pointer `*const i32` to fat pointer `*const [i32]`
|
2017-12-10 14:29:24 -06:00
|
|
|
--> $DIR/fat-ptr-cast.rs:29:5
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | q as *const [i32]; //~ ERROR cannot cast
|
2017-12-10 13:47:55 -06:00
|
|
|
| ^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0606]: casting `usize` as `*mut Trait + 'static` is invalid
|
2017-12-10 14:29:24 -06:00
|
|
|
--> $DIR/fat-ptr-cast.rs:32:37
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | let t: *mut (Trait + 'static) = 0 as *mut _; //~ ERROR casting
|
2017-12-10 13:47:55 -06:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0606]: casting `usize` as `*const str` is invalid
|
2017-12-10 14:29:24 -06:00
|
|
|
--> $DIR/fat-ptr-cast.rs:33:32
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | let mut fail: *const str = 0 as *const str; //~ ERROR casting
|
2017-12-10 13:47:55 -06:00
|
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|
2018-02-19 14:40:25 -06:00
|
|
|
You've got a few errors: E0605, E0606, E0607
|
|
|
|
If you want more information on an error, try using "rustc --explain E0605"
|