mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-05 14:37:37 +00:00
13 lines
234 B
Rust
13 lines
234 B
Rust
![]() |
#![feature(impl_trait_in_bindings)]
|
||
|
|
||
|
trait Static: 'static {}
|
||
|
impl<T: 'static> Static for T {}
|
||
|
|
||
|
struct W<T>(T);
|
||
|
|
||
|
fn main() {
|
||
|
let local = 0;
|
||
|
let _: W<impl Static> = W(&local);
|
||
|
//~^ ERROR `local` does not live long enough
|
||
|
}
|