@@ -441,6 +441,11 @@ fn convert_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item_id: ast::NodeId) {
441
441
tcx. at ( it. span ) . super_predicates_of ( def_id) ;
442
442
tcx. predicates_of ( def_id) ;
443
443
} ,
444
+ hir:: ItemTraitAlias ( ..) => {
445
+ tcx. generics_of ( def_id) ;
446
+ tcx. trait_def ( def_id) ;
447
+ tcx. predicates_of ( def_id) ;
448
+ } ,
444
449
hir:: ItemStruct ( ref struct_def, _) |
445
450
hir:: ItemUnion ( ref struct_def, _) => {
446
451
tcx. generics_of ( def_id) ;
@@ -672,6 +677,7 @@ fn super_predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
672
677
673
678
let ( generics, bounds) = match item. node {
674
679
hir:: ItemTrait ( .., ref generics, ref supertraits, _) => ( generics, supertraits) ,
680
+ hir:: ItemTraitAlias ( ref generics, ref supertraits) => ( generics, supertraits) ,
675
681
_ => span_bug ! ( item. span,
676
682
"super_predicates invoked on non-trait" ) ,
677
683
} ;
@@ -715,6 +721,7 @@ fn trait_def<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
715
721
716
722
let unsafety = match item. node {
717
723
hir:: ItemTrait ( _, unsafety, ..) => unsafety,
724
+ hir:: ItemTraitAlias ( ..) => hir:: Unsafety :: Normal ,
718
725
_ => span_bug ! ( item. span, "trait_def_of_item invoked on non-trait" ) ,
719
726
} ;
720
727
@@ -902,7 +909,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
902
909
( generics, None )
903
910
}
904
911
905
- ItemTrait ( _, _, ref generics, ..) => {
912
+ ItemTrait ( _, _, ref generics, ..) | ItemTraitAlias ( ref generics , .. ) => {
906
913
// Add in the self type parameter.
907
914
//
908
915
// Something of a hack: use the node id for the trait, also as
@@ -1132,7 +1139,7 @@ fn type_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1132
1139
tcx. mk_adt ( def, substs)
1133
1140
}
1134
1141
ItemAutoImpl ( ..) |
1135
- ItemTrait ( ..) |
1142
+ ItemTrait ( ..) | ItemTraitAlias ( .. ) |
1136
1143
ItemMod ( ..) |
1137
1144
ItemForeignMod ( ..) |
1138
1145
ItemGlobalAsm ( ..) |
0 commit comments