summaryrefslogtreecommitdiffstats
path: root/src/test/ui/cast/issue-89497.rs
blob: 76301b704c81c08b8b81807152d09a98e99c618d (plain)
1
2
3
4
5
6
7
8
9
10
// 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 as &'static i32 };
    //~^ ERROR: non-primitive cast
    //~| HELP: consider borrowing the value
}