2021-10-04 14:15:02 -05:00
|
|
|
// Regression test for issue #89497.
|
|
|
|
|
2024-02-16 14:02:50 -06:00
|
|
|
//@ run-rustfix
|
2021-10-04 14:15:02 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let pointer: usize = &1_i32 as *const i32 as usize;
|
|
|
|
let _reference: &'static i32 = unsafe { pointer as *const i32 as &'static i32 };
|
|
|
|
//~^ ERROR: non-primitive cast
|
|
|
|
//~| HELP: consider borrowing the value
|
|
|
|
}
|