mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
17 lines
235 B
Rust
17 lines
235 B
Rust
//@ build-pass
|
|
//@ compile-flags: -g -O
|
|
|
|
// Regression test for #147485.
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
pub fn f(x: *const usize) -> &'static usize {
|
|
let mut a = unsafe { &*x };
|
|
a = unsafe { &*x };
|
|
a
|
|
}
|
|
|
|
pub fn g() {
|
|
f(&0);
|
|
}
|