rust/tests/ui/borrowck/anonymous-region-in-apit.rs

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

13 lines
223 B
Rust
Raw Normal View History

#![feature(anonymous_lifetime_in_impl_trait)]
trait Foo<T> {
fn bar(self, baz: T);
}
fn qux(foo: impl Foo<&str>) {
|baz: &str| foo.bar(baz);
//~^ ERROR borrowed data escapes outside of closure
}
fn main() {}