about summary refs log tree commit diff
path: root/tests/ui/const-ptr/pointer-address-stability.rs
blob: 84a36e1ddf5110d6420d8e0ef50247e10b29930c (plain)
1
2
3
4
5
6
7
8
9
10
11
//! 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>.

//@ run-pass

pub fn main() {
    let foo: isize = 1;
    assert_eq!(&foo as *const isize, &foo as *const isize);
}