Skip to content

Possible enhancement for nll::region_infer::RegionInferenceContext #55853

Closed
@ljedrz

Description

@ljedrz

I noticed that constraints, constraint_graph and universal_region_relations (all members of the RegionInferenceContext struct) are wrapped in Rcs, but it doesn't seem necessary - none of them are cloned 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions