rust/tests/ui/nll/issue-69114-static-ty.rs
2023-01-11 09:32:08 +00:00

9 lines
227 B
Rust

// Check that borrowck ensures that `static` items have the expected type.
static FOO: &'static (dyn Fn(&'static u8) + Send + Sync) = &drop;
fn main() {
let n = 42;
FOO(&n);
//~^ ERROR does not live long enough
}