@@ -441,6 +441,11 @@ fn convert_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, item_id: ast::NodeId) {
441441 tcx. at ( it. span ) . super_predicates_of ( def_id) ;
442442 tcx. predicates_of ( def_id) ;
443443 } ,
444+ hir:: ItemTraitAlias ( ..) => {
445+ tcx. generics_of ( def_id) ;
446+ tcx. trait_def ( def_id) ;
447+ tcx. predicates_of ( def_id) ;
448+ } ,
444449 hir:: ItemStruct ( ref struct_def, _) |
445450 hir:: ItemUnion ( ref struct_def, _) => {
446451 tcx. generics_of ( def_id) ;
@@ -672,6 +677,7 @@ fn super_predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
672677
673678 let ( generics, bounds) = match item. node {
674679 hir:: ItemTrait ( .., ref generics, ref supertraits, _) => ( generics, supertraits) ,
680+ hir:: ItemTraitAlias ( ref generics, ref supertraits) => ( generics, supertraits) ,
675681 _ => span_bug ! ( item. span,
676682 "super_predicates invoked on non-trait" ) ,
677683 } ;
@@ -715,6 +721,7 @@ fn trait_def<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
715721
716722 let unsafety = match item. node {
717723 hir:: ItemTrait ( _, unsafety, ..) => unsafety,
724+ hir:: ItemTraitAlias ( ..) => hir:: Unsafety :: Normal ,
718725 _ => span_bug ! ( item. span, "trait_def_of_item invoked on non-trait" ) ,
719726 } ;
720727
@@ -902,7 +909,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
902909 ( generics, None )
903910 }
904911
905- ItemTrait ( _, _, ref generics, ..) => {
912+ ItemTrait ( _, _, ref generics, ..) | ItemTraitAlias ( ref generics , .. ) => {
906913 // Add in the self type parameter.
907914 //
908915 // 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>,
11321139 tcx. mk_adt ( def, substs)
11331140 }
11341141 ItemAutoImpl ( ..) |
1135- ItemTrait ( ..) |
1142+ ItemTrait ( ..) | ItemTraitAlias ( .. ) |
11361143 ItemMod ( ..) |
11371144 ItemForeignMod ( ..) |
11381145 ItemGlobalAsm ( ..) |
0 commit comments