blob: 2c41f62b9fda53077f891a3e2b8b4998f8ed5828 [file] [log] [blame]
//! The recursive method call yields the opaque type. We want
//! to use the impl candidate for `Foo` here without constraining
//! the opaque to `&Foo`.
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@[next] check-pass
use std::ops::Deref;
struct Foo;
impl Foo {
fn method(&self) {}
}
fn via_deref() -> impl Deref<Target = Foo> {
// Currently errors on stable, but should not
if false {
via_deref().method();
}
Box::new(Foo)
//[current]~^ ERROR mismatched types
}
fn main() {}