2025-07-01 19:28:38 +05:00
|
|
|
//! Check that taking the address of a stack variable with `&`
|
|
|
|
|
//! yields a stable and comparable pointer.
|
|
|
|
|
//!
|
|
|
|
|
//! Regression test for <https://github.com/rust-lang/rust/issues/2040>.
|
2012-03-23 16:05:53 +01:00
|
|
|
|
2025-07-01 19:28:38 +05:00
|
|
|
//@ run-pass
|
2015-03-22 13:13:15 -07:00
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2015-03-25 17:06:52 -07:00
|
|
|
let foo: isize = 1;
|
|
|
|
|
assert_eq!(&foo as *const isize, &foo as *const isize);
|
2012-03-23 16:05:53 +01:00
|
|
|
}
|