Possible enhancement for nll::region_infer::RegionInferenceContext #55853
Labels
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I noticed that
constraints
,constraint_graph
anduniversal_region_relations
(all members of theRegionInferenceContext
struct) are wrapped inRc
s, but it doesn't seem necessary - none of them areclone
d anywhere. I thought this might be done in order to reduce the size of theRegionInferenceContext
struct, but the same could also be done to its other components that are bigger thanRc
as well.A comment in
region_infer::mod.rs
suggests that using anRc
"freezes constraints", but if they are just to be frozen a plain immutable reference could used instead, no?cc @nnethercote
The text was updated successfully, but these errors were encountered: