@@ -31,6 +31,7 @@ use crate::borrow_check::{
31
31
} ,
32
32
type_check:: { free_region_relations:: UniversalRegionRelations , Locations } ,
33
33
universal_regions:: UniversalRegions ,
34
+ Frozen ,
34
35
} ;
35
36
36
37
mod dump_mir;
@@ -54,12 +55,12 @@ pub struct RegionInferenceContext<'tcx> {
54
55
liveness_constraints : LivenessValues < RegionVid > ,
55
56
56
57
/// The outlives constraints computed by the type-check.
57
- constraints : Rc < OutlivesConstraintSet > ,
58
+ constraints : Frozen < OutlivesConstraintSet > ,
58
59
59
60
/// The constraint-set, but in graph form, making it easy to traverse
60
61
/// the constraints adjacent to a particular region. Used to construct
61
62
/// the SCC (see `constraint_sccs`) and for error reporting.
62
- constraint_graph : Rc < NormalConstraintGraph > ,
63
+ constraint_graph : Frozen < NormalConstraintGraph > ,
63
64
64
65
/// The SCC computed from `constraints` and the constraint
65
66
/// graph. We have an edge from SCC A to SCC B if `A: B`. Used to
@@ -263,8 +264,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
263
264
. map ( |info| RegionDefinition :: new ( info. universe , info. origin ) )
264
265
. collect ( ) ;
265
266
266
- let constraints = Rc :: new ( outlives_constraints) ; // freeze constraints
267
- let constraint_graph = Rc :: new ( constraints. graph ( definitions. len ( ) ) ) ;
267
+ let constraints = Frozen :: freeze ( outlives_constraints) ;
268
+ let constraint_graph = Frozen :: freeze ( constraints. graph ( definitions. len ( ) ) ) ;
268
269
let fr_static = universal_regions. fr_static ;
269
270
let constraint_sccs = Rc :: new ( constraints. compute_sccs ( & constraint_graph, fr_static) ) ;
270
271
0 commit comments