mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 14:01:51 +00:00
18 lines
348 B
Rust
18 lines
348 B
Rust
//@ 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);
|
|
}
|