@@ -10,7 +10,7 @@ use prusti_rustc_interface::{
10
10
borrow_set:: BorrowData ,
11
11
consumers:: { BorrowIndex , Borrows , OutlivesConstraint , PoloniusInput , RustcFacts } ,
12
12
} ,
13
- data_structures:: fx:: FxHashMap ,
13
+ data_structures:: fx:: { FxHashMap , FxHashSet } ,
14
14
dataflow:: { Analysis , ResultsCursor } ,
15
15
index:: IndexVec ,
16
16
middle:: {
@@ -30,7 +30,6 @@ pub struct OutlivesInfo<'tcx> {
30
30
pub local_constraints : Vec < OutlivesConstraint < ' tcx > > , // but with no location info
31
31
pub type_ascription_constraints : Vec < OutlivesConstraint < ' tcx > > ,
32
32
pub location_constraints : FxHashMap < Location , Vec < OutlivesConstraint < ' tcx > > > ,
33
-
34
33
pub universal_constraints : Vec < ( RegionVid , RegionVid ) > ,
35
34
}
36
35
@@ -40,7 +39,8 @@ impl<'tcx> OutlivesInfo<'tcx> {
40
39
facts2 : & BorrowckFacts2 < ' tcx > ,
41
40
ri : & RegionInfo < ' tcx > ,
42
41
) -> Self {
43
- let universal_constraints = input_facts. known_placeholder_subset . clone ( ) ;
42
+ let mut universal_constraints =
43
+ FxHashSet :: from_iter ( input_facts. known_placeholder_subset . iter ( ) . copied ( ) ) ;
44
44
45
45
let mut universal_local_constraints = Vec :: new ( ) ;
46
46
let mut local_constraints = Vec :: new ( ) ;
@@ -57,7 +57,8 @@ impl<'tcx> OutlivesInfo<'tcx> {
57
57
if ri. map . is_universal ( constraint. sup ) && ri. map . is_universal ( constraint. sub ) {
58
58
// Not sure why the `region_inference_context` can rarely contain inter-universal constraints,
59
59
// but we should already have all of these in `universal_constraints`.
60
- assert ! ( universal_constraints. contains( & ( constraint. sup, constraint. sub) ) ) ;
60
+ // Except for even more rare situations...
61
+ universal_constraints. insert ( ( constraint. sup , constraint. sub ) ) ;
61
62
} else {
62
63
universal_local_constraints. push ( constraint) ;
63
64
}
@@ -72,7 +73,7 @@ impl<'tcx> OutlivesInfo<'tcx> {
72
73
local_constraints,
73
74
type_ascription_constraints,
74
75
location_constraints,
75
- universal_constraints,
76
+ universal_constraints : universal_constraints . into_iter ( ) . collect ( ) ,
76
77
}
77
78
}
78
79
0 commit comments