]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-lifetime-static-items-enclosing-scopes.rs
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
[rust.git] / tests / ui / regions / regions-lifetime-static-items-enclosing-scopes.rs
1 // run-pass
2 #![allow(dead_code)]
3 // This test verifies that temporary lifetime is correctly computed
4 // for static objects in enclosing scopes.
5
6
7 use std::cmp::PartialEq;
8
9 fn f<T:PartialEq+std::fmt::Debug>(o: &mut Option<T>) {
10     assert_eq!(*o, None);
11 }
12
13 pub fn main() {
14     mod t {
15         enum E {V=1, A=0}
16         static C: E = E::V;
17     }
18
19     f::<isize>(&mut None);
20 }