@@ -714,7 +714,7 @@ fn trait_def<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
714
714
715
715
let ( is_auto, unsafety) = match item. node {
716
716
hir:: ItemTrait ( is_auto, unsafety, ..) => ( is_auto == hir:: IsAuto :: Yes , unsafety) ,
717
- hir:: ItemTraitAlias ( ..) => ( hir :: IsAuto :: No , hir:: Unsafety :: Normal ) ,
717
+ hir:: ItemTraitAlias ( ..) => ( false , hir:: Unsafety :: Normal ) ,
718
718
_ => span_bug ! ( item. span, "trait_def_of_item invoked on non-trait" ) ,
719
719
} ;
720
720
@@ -1714,54 +1714,3 @@ fn is_foreign_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
1714
1714
_ => bug ! ( "is_foreign_item applied to non-local def-id {:?}" , def_id)
1715
1715
}
1716
1716
}
1717
-
1718
- struct ImplTraitUniversalInfo < ' hir > {
1719
- id : ast:: NodeId ,
1720
- def_id : DefId ,
1721
- span : Span ,
1722
- bounds : & ' hir [ hir:: TyParamBound ] ,
1723
- }
1724
-
1725
- /// Take some possible list of arguments and return the DefIds of the ImplTraitUniversal
1726
- /// arguments
1727
- fn extract_universal_impl_trait_info < ' a , ' tcx > ( tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
1728
- opt_inputs : Option < & ' tcx [ P < hir:: Ty > ] > )
1729
- -> Vec < ImplTraitUniversalInfo < ' tcx > >
1730
- {
1731
- // A visitor for simply collecting Universally quantified impl Trait arguments
1732
- struct ImplTraitUniversalVisitor < ' tcx > {
1733
- items : Vec < & ' tcx hir:: Ty >
1734
- }
1735
-
1736
- impl < ' tcx > Visitor < ' tcx > for ImplTraitUniversalVisitor < ' tcx > {
1737
- fn nested_visit_map < ' this > ( & ' this mut self ) -> NestedVisitorMap < ' this , ' tcx > {
1738
- NestedVisitorMap :: None
1739
- }
1740
-
1741
- fn visit_ty ( & mut self , ty : & ' tcx hir:: Ty ) {
1742
- if let hir:: TyImplTraitUniversal ( ..) = ty. node {
1743
- self . items . push ( ty) ;
1744
- }
1745
- intravisit:: walk_ty ( self , ty) ;
1746
- }
1747
- }
1748
-
1749
- let mut visitor = ImplTraitUniversalVisitor { items : Vec :: new ( ) } ;
1750
-
1751
- if let Some ( inputs) = opt_inputs {
1752
- for t in inputs. iter ( ) {
1753
- visitor. visit_ty ( t) ;
1754
- }
1755
- }
1756
-
1757
- visitor. items . into_iter ( ) . map ( |ty| if let hir:: TyImplTraitUniversal ( _, ref bounds) = ty. node {
1758
- ImplTraitUniversalInfo {
1759
- id : ty. id ,
1760
- def_id : tcx. hir . local_def_id ( ty. id ) ,
1761
- span : ty. span ,
1762
- bounds : bounds
1763
- }
1764
- } else {
1765
- span_bug ! ( ty. span, "this type should be a universally quantified impl trait. this is a bug" )
1766
- } ) . collect ( )
1767
- }
0 commit comments