rust/tests/ui/impl-trait/implicit-capture-late.rs

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

15 lines
293 B
Rust
Raw Normal View History

//@ edition: 2024
#![feature(rustc_attrs)]
#![allow(internal_features)]
#![rustc_variance_of_opaques]
use std::ops::Deref;
fn foo(x: Vec<i32>) -> Box<dyn for<'a> Deref<Target = impl ?Sized>> { //~ ['a: o]
//~^ ERROR cannot capture higher-ranked lifetime
Box::new(x)
}
fn main() {}