Do not assemble candidates for auto traits of opaque types in their defining scope
This commit is contained in:
parent
548c44760f
commit
8ea461da55
16 changed files with 93 additions and 54 deletions
|
@ -3,7 +3,6 @@
|
|||
|
||||
//@ revisions: next old
|
||||
//@[next] compile-flags: -Znext-solver
|
||||
//@[old]check-pass
|
||||
|
||||
fn is_trait<T: Trait<U>, U: Default>(_: T) -> U {
|
||||
Default::default()
|
||||
|
@ -14,7 +13,7 @@ impl<T: Send> Trait<u32> for T {}
|
|||
impl<T> Trait<i32> for T {}
|
||||
fn foo() -> impl Sized {
|
||||
if false { is_trait(foo()) } else { Default::default() }
|
||||
//[next]~^ ERROR: type annotations needed
|
||||
//~^ ERROR: type annotations needed
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue