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.
This commit is contained in:
Oli Scherer 2021-07-16 17:34:23 +00:00
parent 24a8d3bce3
commit ebe21ac23a
5 changed files with 36 additions and 144 deletions

View file

@ -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

View file

@ -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