rust/tests/ui/regions/regions-lifetime-static-items-enclosing-scopes.rs
surechen 40ae34194c remove redundant imports
detects redundant imports that can be eliminated.

for #117772 :

In order to facilitate review and modification, split the checking code and
removing redundant imports code into two PR.
2023-12-10 10:56:22 +08:00

18 lines
347 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);
}