Consider trait aliases

This commit is contained in:
Esteban Küber 2019-10-08 16:13:20 -07:00
parent ca1885de41
commit b81df6b739
2 changed files with 7 additions and 3 deletions

View File

@ -1029,6 +1029,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
hir::Node::Item(hir::Item {
kind: hir::ItemKind::TyAlias(_, generics), span, ..
}) |
hir::Node::Item(hir::Item {
kind: hir::ItemKind::TraitAlias(generics, _), span, ..
}) |
hir::Node::Item(hir::Item {
kind: hir::ItemKind::OpaqueTy(hir::OpaqueTy { generics, .. }), span, ..
}) |

View File

@ -4,9 +4,10 @@ error[E0277]: the trait bound `T: Foo` is not satisfied
LL | trait A<T: Foo> {}
| --------------- required by `A`
LL | trait B<T> = A<T>;
| ^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `T`
|
= help: consider adding a `where T: Foo` bound
| ^^^^^^^^-^^^^^^^^^
| | |
| | help: consider restricting this bound: `T: Foo`
| the trait `Foo` is not implemented for `T`
error: aborting due to previous error