]>
Commit | Line | Data |
---|---|---|
ff7c6d11 | 1 | error[E0606]: casting `&[i32]` as `usize` is invalid |
0731742a | 2 | --> $DIR/fat-ptr-cast.rs:10:5 |
ff7c6d11 | 3 | | |
0531ce1d | 4 | LL | a as usize; //~ ERROR casting |
ff7c6d11 XL |
5 | | ^^^^^^^^^^ |
6 | | | |
7 | = help: cast through a raw pointer first | |
8 | ||
9 | error[E0606]: casting `&[i32]` as `isize` is invalid | |
0731742a | 10 | --> $DIR/fat-ptr-cast.rs:11:5 |
ff7c6d11 | 11 | | |
0531ce1d | 12 | LL | a as isize; //~ ERROR casting |
ff7c6d11 | 13 | | ^^^^^^^^^^ |
2c00a5a8 XL |
14 | | |
15 | = help: cast through a raw pointer first | |
ff7c6d11 XL |
16 | |
17 | error[E0606]: casting `&[i32]` as `i16` is invalid | |
0731742a | 18 | --> $DIR/fat-ptr-cast.rs:12:5 |
ff7c6d11 | 19 | | |
0531ce1d | 20 | LL | a as i16; //~ ERROR casting `&[i32]` as `i16` is invalid |
ff7c6d11 | 21 | | ^^^^^^^^ |
2c00a5a8 XL |
22 | | |
23 | = help: cast through a raw pointer first | |
ff7c6d11 XL |
24 | |
25 | error[E0606]: casting `&[i32]` as `u32` is invalid | |
0731742a | 26 | --> $DIR/fat-ptr-cast.rs:13:5 |
ff7c6d11 | 27 | | |
0531ce1d | 28 | LL | a as u32; //~ ERROR casting `&[i32]` as `u32` is invalid |
ff7c6d11 | 29 | | ^^^^^^^^ |
2c00a5a8 XL |
30 | | |
31 | = help: cast through a raw pointer first | |
ff7c6d11 XL |
32 | |
33 | error[E0605]: non-primitive cast: `std::boxed::Box<[i32]>` as `usize` | |
0731742a | 34 | --> $DIR/fat-ptr-cast.rs:14:5 |
ff7c6d11 | 35 | | |
0531ce1d | 36 | LL | b as usize; //~ ERROR non-primitive cast |
ff7c6d11 XL |
37 | | ^^^^^^^^^^ |
38 | | | |
39 | = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait | |
40 | ||
41 | error[E0606]: casting `*const [i32]` as `usize` is invalid | |
0731742a | 42 | --> $DIR/fat-ptr-cast.rs:15:5 |
ff7c6d11 | 43 | | |
0531ce1d | 44 | LL | p as usize; |
ff7c6d11 XL |
45 | | ^^^^^^^^^^ |
46 | | | |
47 | = help: cast through a thin pointer first | |
48 | ||
49 | error[E0607]: cannot cast thin pointer `*const i32` to fat pointer `*const [i32]` | |
0731742a | 50 | --> $DIR/fat-ptr-cast.rs:19:5 |
ff7c6d11 | 51 | | |
0531ce1d | 52 | LL | q as *const [i32]; //~ ERROR cannot cast |
ff7c6d11 XL |
53 | | ^^^^^^^^^^^^^^^^^ |
54 | ||
8faf50e0 | 55 | error[E0606]: casting `usize` as `*mut (dyn Trait + 'static)` is invalid |
0731742a | 56 | --> $DIR/fat-ptr-cast.rs:22:37 |
ff7c6d11 | 57 | | |
0531ce1d | 58 | LL | let t: *mut (Trait + 'static) = 0 as *mut _; //~ ERROR casting |
ff7c6d11 XL |
59 | | ^^^^^^^^^^^ |
60 | ||
61 | error[E0606]: casting `usize` as `*const str` is invalid | |
0731742a | 62 | --> $DIR/fat-ptr-cast.rs:23:32 |
ff7c6d11 | 63 | | |
0531ce1d | 64 | LL | let mut fail: *const str = 0 as *const str; //~ ERROR casting |
ff7c6d11 XL |
65 | | ^^^^^^^^^^^^^^^ |
66 | ||
67 | error: aborting due to 9 previous errors | |
68 | ||
0531ce1d XL |
69 | Some errors occurred: E0605, E0606, E0607. |
70 | For more information about an error, try `rustc --explain E0605`. |