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

16 lines
328 B
Rust
Raw Normal View History

2022-07-28 15:18:32 -05:00
#![feature(impl_trait_in_fn_trait_return)]
use std::fmt::Debug;
fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
2022-10-25 08:47:43 -05:00
//~^ ERROR cannot resolve opaque type
|x| x
2022-10-25 08:47:43 -05:00
//~^ ERROR concrete type differs from previous defining opaque type use
}
fn _b<'a>() -> impl Fn(&'a u8) -> (impl Debug + 'a) {
a()
}
fn main() {}