1
Fork 0

Do not assemble candidates for auto traits of opaque types in their defining scope

This commit is contained in:
Oli Scherer 2024-06-04 16:20:01 +00:00
parent 548c44760f
commit 8ea461da55
16 changed files with 93 additions and 54 deletions

View file

@ -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() {}