blob: 76e0556f6b4e0e849a668d78eeb9c00e6f037ff8 [file]
//! The recursive method call yields the opaque type. We want
//! to use the trait candidate for `impl Foo` here while not
//! applying it for the `impl Deref`.
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
//@ check-pass
use std::ops::Deref;
trait Foo {
fn method(&self) {}
}
impl Foo for u32 {}
fn via_deref() -> impl Deref<Target = impl Foo> {
if false {
via_deref().method();
}
Box::new(1u32)
}
fn via_deref_nested() -> Box<impl Deref<Target = impl Foo>> {
if false {
via_deref_nested().method();
}
Box::new(Box::new(1u32))
}
fn main() {}