From ebe21ac23a8a259079c9c59669c1d7da1fa88d0c Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Fri, 16 Jul 2021 17:34:23 +0000 Subject: Infer all inference variables via InferCx The previous algorithm was correct for the example given in its documentation, but when the TAIT was declared as a free item instead of an associated item, the generic parameters were the wrong ones. --- src/test/ui/type-alias-impl-trait/issue-60371.rs | 2 +- src/test/ui/type-alias-impl-trait/issue-60371.stderr | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/test') diff --git a/src/test/ui/type-alias-impl-trait/issue-60371.rs b/src/test/ui/type-alias-impl-trait/issue-60371.rs index 4ac7f9423ff..b7c8a58a656 100644 --- a/src/test/ui/type-alias-impl-trait/issue-60371.rs +++ b/src/test/ui/type-alias-impl-trait/issue-60371.rs @@ -9,7 +9,7 @@ trait Bug { impl Bug for &() { type Item = impl Bug; //~ ERROR `impl Trait` in type aliases is unstable //~^ ERROR the trait bound `(): Bug` is not satisfied - //~^^ ERROR could not find defining uses + //~^^ ERROR the trait bound `(): Bug` is not satisfied const FUN: fn() -> Self::Item = || (); //~^ ERROR type alias impl trait is not permitted here diff --git a/src/test/ui/type-alias-impl-trait/issue-60371.stderr b/src/test/ui/type-alias-impl-trait/issue-60371.stderr index 255d381bf06..6857d5264b6 100644 --- a/src/test/ui/type-alias-impl-trait/issue-60371.stderr +++ b/src/test/ui/type-alias-impl-trait/issue-60371.stderr @@ -25,11 +25,14 @@ LL | type Item = impl Bug; = help: the following implementations were found: <&() as Bug> -error: could not find defining uses +error[E0277]: the trait bound `(): Bug` is not satisfied --> $DIR/issue-60371.rs:10:17 | LL | type Item = impl Bug; - | ^^^^^^^^ + | ^^^^^^^^ the trait `Bug` is not implemented for `()` + | + = help: the following implementations were found: + <&() as Bug> error: aborting due to 4 previous errors -- cgit 1.4.1-3-g733a5