Closed
Description
@nikomatsakis is concerned that two-phased borrows are a hazard. In particular, they are coupled to MIR code-generation, which means if we are too aggressive in how much code we accept today, it could mean that a later change to MIR construction will inject a regression.
Niko has suggested a simple strategy for fixing this that we should deploy before we stabilize two-phase borrows: We should thread through information about whether a borrow was introduced via method-call autoref, and then only do the two-phase borrow system for those autorefs.
That way we will be somewhat conservative in what code is deemed acceptable by two-phase borrows today, and therefore give us more breathing room in the future as we refine the system.