rust/tests/ui/impl-trait/in-bindings/lifetime-failure.rs

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

13 lines
234 B
Rust
Raw Normal View History

2024-12-11 22:18:39 +00:00
#![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
}