-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.NLL-performantWorking towards the "performance is good" goalWorking towards the "performance is good" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
The following snippet of code is an O(n^2) loop:
https://gist.github.com/lqd/7e178cb9ac8302e24272965048627f21#file-mod-rs-L243-L256
The problem is that we are iterating over each temporary and then invoking find_assignments
, which basically walks over the MIR again. What we really want to be doing is walking the MIR at most once (ideally, coallesced into some other walk) and registered the "used mut" assignments.
Metadata
Metadata
Assignees
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.NLL-performantWorking towards the "performance is good" goalWorking towards the "performance is good" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.