File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed
src/librustc_mir/transform Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -119,21 +119,18 @@ impl<'tcx> Lattice for CsLattice<'tcx> {
119
119
fn join ( & mut self , mut other : Self ) -> bool {
120
120
// Calculate inteersection this way:
121
121
let mut changed = false ;
122
-
123
122
// First, drain the self.values into a list of equal values common to both maps.
124
123
let mut common_keys = vec ! [ ] ;
125
- for ( key, value) in self . values . drain ( ) {
124
+ for ( key, mut value) in self . values . drain ( ) {
126
125
match other. values . remove ( & key) {
127
126
// self had the key, but not other, so removing
128
- None => changed = true ,
129
- Some ( ov) => if ov. eq ( & value) {
130
- // common key, equal value
131
- common_keys. push ( ( key, value) )
132
- } else {
133
- // both had key, but different values, so its a top.
134
- common_keys. push ( ( key, Either :: Top ) ) ;
127
+ None => {
135
128
changed = true ;
136
- } ,
129
+ }
130
+ Some ( ov) => {
131
+ changed |= value. join ( ov) ;
132
+ common_keys. push ( ( key, value) ) ;
133
+ }
137
134
}
138
135
}
139
136
// Now, put each common key with equal value back into the map.
You can’t perform that action at this time.
0 commit comments