@@ -89,12 +89,9 @@ impl<'tcx> GenKillAnalysis<'tcx> for MaybeLiveLocals {
89
89
}
90
90
}
91
91
92
- pub struct TransferFunction < ' a , T > ( pub & ' a mut T ) ;
92
+ pub struct TransferFunction < ' a > ( pub & ' a mut BitSet < Local > ) ;
93
93
94
- impl < ' tcx , T > Visitor < ' tcx > for TransferFunction < ' _ , T >
95
- where
96
- T : GenKill < Local > ,
97
- {
94
+ impl < ' tcx > Visitor < ' tcx > for TransferFunction < ' _ > {
98
95
fn visit_place ( & mut self , place : & mir:: Place < ' tcx > , context : PlaceContext , location : Location ) {
99
96
if let PlaceContext :: MutatingUse ( MutatingUseContext :: Yield ) = context {
100
97
// The resume place is evaluated and assigned to only after coroutine resumes, so its
@@ -108,10 +105,10 @@ where
108
105
MutatingUseContext :: Call | MutatingUseContext :: AsmOutput ,
109
106
) = context
110
107
{
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`.
115
112
} else {
116
113
self . 0 . kill ( place. local ) ;
117
114
}
@@ -128,12 +125,9 @@ where
128
125
}
129
126
}
130
127
131
- struct YieldResumeEffect < ' a , T > ( & ' a mut T ) ;
128
+ struct YieldResumeEffect < ' a > ( & ' a mut BitSet < Local > ) ;
132
129
133
- impl < ' tcx , T > Visitor < ' tcx > for YieldResumeEffect < ' _ , T >
134
- where
135
- T : GenKill < Local > ,
136
- {
130
+ impl < ' tcx > Visitor < ' tcx > for YieldResumeEffect < ' _ > {
137
131
fn visit_place ( & mut self , place : & mir:: Place < ' tcx > , context : PlaceContext , location : Location ) {
138
132
DefUse :: apply ( self . 0 , * place, context) ;
139
133
self . visit_projection ( place. as_ref ( ) , context, location) ;
@@ -151,7 +145,7 @@ enum DefUse {
151
145
}
152
146
153
147
impl DefUse {
154
- fn apply ( trans : & mut impl GenKill < Local > , place : Place < ' _ > , context : PlaceContext ) {
148
+ fn apply ( trans : & mut BitSet < Local > , place : Place < ' _ > , context : PlaceContext ) {
155
149
match DefUse :: for_place ( place, context) {
156
150
Some ( DefUse :: Def ) => trans. kill ( place. local ) ,
157
151
Some ( DefUse :: Use ) => trans. gen_ ( place. local ) ,
0 commit comments