Skip to content

Commit b81df6b

Browse files
committed
Consider trait aliases
1 parent ca1885d commit b81df6b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/librustc/traits/error_reporting.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
10291029
hir::Node::Item(hir::Item {
10301030
kind: hir::ItemKind::TyAlias(_, generics), span, ..
10311031
}) |
1032+
hir::Node::Item(hir::Item {
1033+
kind: hir::ItemKind::TraitAlias(generics, _), span, ..
1034+
}) |
10321035
hir::Node::Item(hir::Item {
10331036
kind: hir::ItemKind::OpaqueTy(hir::OpaqueTy { generics, .. }), span, ..
10341037
}) |

src/test/ui/traits/trait-alias/trait-alias-wf.stderr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ error[E0277]: the trait bound `T: Foo` is not satisfied
44
LL | trait A<T: Foo> {}
55
| --------------- required by `A`
66
LL | trait B<T> = A<T>;
7-
| ^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `T`
8-
|
9-
= help: consider adding a `where T: Foo` bound
7+
| ^^^^^^^^-^^^^^^^^^
8+
| | |
9+
| | help: consider restricting this bound: `T: Foo`
10+
| the trait `Foo` is not implemented for `T`
1011

1112
error: aborting due to previous error
1213

0 commit comments

Comments
 (0)