Closed
Description
I noticed that constraints
, constraint_graph
and universal_region_relations
(all members of the RegionInferenceContext
struct) are wrapped in Rc
s, but it doesn't seem necessary - none of them are clone
d anywhere. I thought this might be done in order to reduce the size of the RegionInferenceContext
struct, but the same could also be done to its other components that are bigger than Rc
as well.
A comment in region_infer::mod.rs
suggests that using an Rc
"freezes constraints", but if they are just to be frozen a plain immutable reference could used instead, no?
cc @nnethercote