rust/tests/ui/impl-trait/impl-fn-parsing-ambiguities.rs

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

16 lines
346 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() -> impl Fn(&u8) -> impl Debug + '_ {
//~^ ERROR ambiguous `+` in a type
//~| ERROR cannot capture higher-ranked lifetime from outer `impl Trait`
|x| x
}
fn b() -> impl Fn() -> impl Debug + Send {
//~^ ERROR ambiguous `+` in a type
|| ()
}
fn main() {}