affected test
- tests/ui/impl-trait/recursive-bound-eval.rs
pub trait Parser<E> {
fn parse(&self) -> E;
}
impl<E, T: Fn() -> E> Parser<E> for T {
fn parse(&self) -> E {
self()
}
}
pub fn recursive_fn<E>() -> impl Parser<E> {
move || recursive_fn().parse()
}
fn main() {}
Even when allowing the method call, we end up with following opaque type definitions and ambiguous goal
opaque<?recursive_call> = ?infer
opaque<E> = closure<fn() -> E>
?infer: Parser<E> (from the .parse() call)
We could (and maybe should) apply, the defining use opaque<E> = closure<fn() -> E> to opaque<?recursive_call>, equating ?infer with closure<fn() -> ?recursive_call>, at which point this will compile after proving closure<fn() -> ?recursive_call>: Parser<E>.
affected test
Even when allowing the method call, we end up with following opaque type definitions and ambiguous goal
opaque<?recursive_call> = ?inferopaque<E> = closure<fn() -> E>?infer: Parser<E>(from the.parse()call)We could (and maybe should) apply, the defining use
opaque<E> = closure<fn() -> E>toopaque<?recursive_call>, equating?inferwithclosure<fn() -> ?recursive_call>, at which point this will compile after provingclosure<fn() -> ?recursive_call>: Parser<E>.