2021-04-15 16:17:44 -05:00
|
|
|
//@ run-rustfix
|
|
|
|
|
|
|
|
struct Something {
|
|
|
|
pub field: u32,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut something = Something { field: 1337 };
|
2021-05-15 05:58:23 -05:00
|
|
|
let _ = something.field;
|
2021-04-15 16:17:44 -05:00
|
|
|
|
|
|
|
let _pointer_to_something = something as *const Something;
|
|
|
|
//~^ ERROR: non-primitive cast
|
|
|
|
|
|
|
|
let _mut_pointer_to_something = something as *mut Something;
|
|
|
|
//~^ ERROR: non-primitive cast
|
|
|
|
}
|