summaryrefslogtreecommitdiffstats
path: root/tests/ui/regions/regions-lifetime-static-items-enclosing-scopes.rs
blob: 2c455fc35634f06484b65d8faced87778b387988 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass
#![allow(dead_code)]
// This test verifies that temporary lifetime is correctly computed
// for static objects in enclosing scopes.

fn f<T:PartialEq+std::fmt::Debug>(o: &mut Option<T>) {
    assert_eq!(*o, None);
}

pub fn main() {
    mod t {
        enum E {V=1, A=0}
        static C: E = E::V;
    }

    f::<isize>(&mut None);
}