rust/tests/ui/regions/regions-lifetime-static-items-enclosing-scopes.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
374 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
// This test verifies that temporary lifetime is correctly computed
// for static objects in enclosing scopes.
use std::cmp::PartialEq;
2011-09-23 00:50:12 -05:00
fn f<T:PartialEq+std::fmt::Debug>(o: &mut Option<T>) {
assert_eq!(*o, None);
2011-09-23 00:50:12 -05:00
}
pub fn main() {
mod t {
enum E {V=1, A=0}
static C: E = E::V;
}
f::<isize>(&mut None);
2012-08-27 18:26:35 -05:00
}