@@ -89,12 +89,9 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveLocals {
8989 }
9090}
9191
92- pub struct TransferFunction < ' a , T > ( pub & ' a mut T ) ;
92+ pub struct TransferFunction < ' a > ( pub & ' a mut BitSet < Local > ) ;
9393
94- impl < ' tcx , T > Visitor < ' tcx > for TransferFunction < ' _ , T >
95- where
96- T : GenKill < Local > ,
97- {
94+ impl < ' tcx > Visitor < ' tcx > for TransferFunction < ' _ > {
9895 fn visit_place ( & mut self , place : & mir:: Place < ' tcx > , context : PlaceContext , location : Location ) {
9996 if let PlaceContext :: MutatingUse ( MutatingUseContext :: Yield ) = context {
10097 // The resume place is evaluated and assigned to only after coroutine resumes, so its
@@ -108,10 +105,10 @@ where
108105 MutatingUseContext :: Call | MutatingUseContext :: AsmOutput ,
109106 ) = context
110107 {
111- // For the associated terminators, this is only a `Def` when the terminator returns
112- // "successfully." As such, we handle this case separately in `call_return_effect`
113- // above. However, if the place looks like `*_5`, this is still unconditionally a use of
114- // `_5`.
108+ // For the associated terminators, this is only a `Def` when the terminator
109+ // returns "successfully." As such, we handle this case separately in
110+ // `call_return_effect` above. However, if the place looks like `*_5`, this is
111+ // still unconditionally a use of `_5`.
115112 } else {
116113 self . 0 . kill ( place. local ) ;
117114 }
@@ -128,12 +125,9 @@ where
128125 }
129126}
130127
131- struct YieldResumeEffect < ' a , T > ( & ' a mut T ) ;
128+ struct YieldResumeEffect < ' a > ( & ' a mut BitSet < Local > ) ;
132129
133- impl < ' tcx , T > Visitor < ' tcx > for YieldResumeEffect < ' _ , T >
134- where
135- T : GenKill < Local > ,
136- {
130+ impl < ' tcx > Visitor < ' tcx > for YieldResumeEffect < ' _ > {
137131 fn visit_place ( & mut self , place : & mir:: Place < ' tcx > , context : PlaceContext , location : Location ) {
138132 DefUse :: apply ( self . 0 , * place, context) ;
139133 self . visit_projection ( place. as_ref ( ) , context, location) ;
@@ -151,7 +145,7 @@ enum DefUse {
151145}
152146
153147impl DefUse {
154- fn apply ( trans : & mut impl GenKill < Local > , place : Place < ' _ > , context : PlaceContext ) {
148+ fn apply ( trans : & mut BitSet < Local > , place : Place < ' _ > , context : PlaceContext ) {
155149 match DefUse :: for_place ( place, context) {
156150 Some ( DefUse :: Def ) => trans. kill ( place. local ) ,
157151 Some ( DefUse :: Use ) => trans. gen_ ( place. local ) ,
0 commit comments