mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 09:05:00 +00:00
17 lines
359 B
Rust
17 lines
359 B
Rust
//@ run-rustfix
|
|
|
|
struct Something {
|
|
pub field: u32,
|
|
}
|
|
|
|
fn main() {
|
|
let mut something = Something { field: 1337 };
|
|
let _ = something.field;
|
|
|
|
let _pointer_to_something = &something as *const Something;
|
|
//~^ ERROR: non-primitive cast
|
|
|
|
let _mut_pointer_to_something = &mut something as *mut Something;
|
|
//~^ ERROR: non-primitive cast
|
|
}
|