You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #131699 - compiler-errors:better-errors-for-projections, r=lcnr
Try to improve error messages involving aliases in the solver
1. Treat aliases as rigid only if it may not be defined and it's well formed (i.e. for projections, its trait goal is satisfied).
2. Record goals that are related to alias normalization under a new `GoalKind`, so we can look into them in the `BestObligation` visitor.
3. Try to deduplicate errors due to self types of goals that are un-normalizable aliases.
r? lcnr
Copy file name to clipboardExpand all lines: tests/ui/generic-associated-types/ambig-hr-projection-issue-93340.next.stderr
+13-3
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
error[E0283]: type annotations needed
2
-
--> $DIR/ambig-hr-projection-issue-93340.rs:16:5
2
+
--> $DIR/ambig-hr-projection-issue-93340.rs:17:5
3
3
|
4
4
LL | cmp_eq
5
5
| ^^^^^^ cannot infer type of the type parameter `A` declared on the function `cmp_eq`
@@ -15,6 +15,16 @@ help: consider specifying the generic arguments
15
15
LL | cmp_eq::<A, B, O>
16
16
| +++++++++++
17
17
18
-
error: aborting due to 1 previous error
18
+
error[E0277]: expected a `Fn(<A as Scalar>::RefType<'_>, <B as Scalar>::RefType<'_>)` closure, found `for<'a, 'b> fn(<O as Scalar>::RefType<'a>, <_ as Scalar>::RefType<'b>) -> O {cmp_eq::<O, _, O>}`
| |_________________________________________________^ expected an `Fn(<A as Scalar>::RefType<'_>, <B as Scalar>::RefType<'_>)` closure, found `for<'a, 'b> fn(<O as Scalar>::RefType<'a>, <_ as Scalar>::RefType<'b>) -> O {cmp_eq::<O, _, O>}`
24
+
|
25
+
= help: the trait `for<'a, 'b> Fn(<A as Scalar>::RefType<'a>, <B as Scalar>::RefType<'b>)` is not implemented for fn item `for<'a, 'b> fn(<O as Scalar>::RefType<'a>, <_ as Scalar>::RefType<'b>) -> O {cmp_eq::<O, _, O>}`
26
+
27
+
error: aborting due to 2 previous errors
19
28
20
-
For more information about this error, try `rustc --explain E0283`.
29
+
Some errors have detailed explanations: E0277, E0283.
30
+
For more information about an error, try `rustc --explain E0277`.
0 commit comments