mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
10 lines
227 B
Rust
10 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
|
||
|
}
|