File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
compiler/rustc_const_eval/src/transform/check_consts Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ where
256256 }
257257}
258258
259- #[ derive( Clone , Debug , PartialEq , Eq ) ]
259+ #[ derive( Debug , PartialEq , Eq ) ]
260260pub ( super ) struct State {
261261 /// Describes whether a local contains qualif.
262262 pub qualif : BitSet < Local > ,
@@ -265,6 +265,19 @@ pub(super) struct State {
265265 pub borrow : BitSet < Local > ,
266266}
267267
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+
268281impl State {
269282 #[ inline]
270283 pub ( super ) fn contains ( & self , local : Local ) -> bool {
You can’t perform that action at this time.
0 commit comments