File tree 1 file changed +14
-1
lines changed
compiler/rustc_const_eval/src/transform/check_consts
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ where
256
256
}
257
257
}
258
258
259
- #[ derive( Clone , Debug , PartialEq , Eq ) ]
259
+ #[ derive( Debug , PartialEq , Eq ) ]
260
260
pub ( super ) struct State {
261
261
/// Describes whether a local contains qualif.
262
262
pub qualif : BitSet < Local > ,
@@ -265,6 +265,19 @@ pub(super) struct State {
265
265
pub borrow : BitSet < Local > ,
266
266
}
267
267
268
+ impl Clone for State {
269
+ fn clone ( & self ) -> Self {
270
+ State { qualif : self . qualif . clone ( ) , borrow : self . borrow . clone ( ) }
271
+ }
272
+
273
+ // Data flow engine when possible uses `clone_from` for domain values.
274
+ // Providing an implementation will avoid some intermediate memory allocations.
275
+ fn clone_from ( & mut self , other : & Self ) {
276
+ self . qualif . clone_from ( & other. qualif ) ;
277
+ self . borrow . clone_from ( & other. borrow ) ;
278
+ }
279
+ }
280
+
268
281
impl State {
269
282
#[ inline]
270
283
pub ( super ) fn contains ( & self , local : Local ) -> bool {
You can’t perform that action at this time.
0 commit comments