rust/tests/ui/impl-trait/impl-fn-predefined-lifetimes.rs

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

16 lines
358 B
Rust
Raw Normal View History

2022-07-29 00:18:32 +04:00
#![feature(impl_trait_in_fn_trait_return)]
use std::fmt::Debug;
fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
//~^ ERROR cannot resolve opaque type
//~| WARNING elided lifetime has a name
|x| x
2024-03-18 16:03:18 +00:00
//~^ ERROR expected generic lifetime parameter, found `'_`
}
fn _b<'a>() -> impl Fn(&'a u8) -> (impl Debug + 'a) {
a()
}
fn main() {}