mirror of
https://git.proxmox.com/git/rustc
synced 2026-01-24 00:23:55 +00:00
11 lines
277 B
Plaintext
11 lines
277 B
Plaintext
// Regression test for issue #89497.
|
|
|
|
//@ run-rustfix
|
|
|
|
fn main() {
|
|
let pointer: usize = &1_i32 as *const i32 as usize;
|
|
let _reference: &'static i32 = unsafe { &*(pointer as *const i32) };
|
|
//~^ ERROR: non-primitive cast
|
|
//~| HELP: consider borrowing the value
|
|
}
|