@@ -31,6 +31,7 @@ use crate::borrow_check::{
3131 } ,
3232 type_check:: { free_region_relations:: UniversalRegionRelations , Locations } ,
3333 universal_regions:: UniversalRegions ,
34+ Frozen ,
3435} ;
3536
3637mod dump_mir;
@@ -54,12 +55,12 @@ pub struct RegionInferenceContext<'tcx> {
5455 liveness_constraints : LivenessValues < RegionVid > ,
5556
5657 /// The outlives constraints computed by the type-check.
57- constraints : Rc < OutlivesConstraintSet > ,
58+ constraints : Frozen < OutlivesConstraintSet > ,
5859
5960 /// The constraint-set, but in graph form, making it easy to traverse
6061 /// the constraints adjacent to a particular region. Used to construct
6162 /// the SCC (see `constraint_sccs`) and for error reporting.
62- constraint_graph : Rc < NormalConstraintGraph > ,
63+ constraint_graph : Frozen < NormalConstraintGraph > ,
6364
6465 /// The SCC computed from `constraints` and the constraint
6566 /// graph. We have an edge from SCC A to SCC B if `A: B`. Used to
@@ -263,8 +264,8 @@ impl<'tcx> RegionInferenceContext<'tcx> {
263264 . map ( |info| RegionDefinition :: new ( info. universe , info. origin ) )
264265 . collect ( ) ;
265266
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 ( ) ) ) ;
268269 let fr_static = universal_regions. fr_static ;
269270 let constraint_sccs = Rc :: new ( constraints. compute_sccs ( & constraint_graph, fr_static) ) ;
270271
0 commit comments