Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upNested method calls with `&mut` receivers result in borrowck errors #6268
Comments
This comment has been minimized.
This comment has been minimized.
|
There are various FIXMEs in the code with commented out bits of code related to this issue. |
nikomatsakis
referenced this issue
May 7, 2013
Closed
Odd loaning errors when similar code works #4666
This comment has been minimized.
This comment has been minimized.
|
Here is a test case (at least I think it relates to this issue):
The error rustc produces is:
|
nikomatsakis
referenced this issue
Jul 3, 2013
Closed
Borrowing &mut multiple times in fn argument list fails, although the borrows do not overlap. #7448
This comment has been minimized.
This comment has been minimized.
|
Nominated for feature complete (not backwards compatible since it generates strictly more errors than it should) |
nikomatsakis
referenced this issue
Jul 11, 2013
Closed
Borrow-check considers argument borrows to live too long #7729
michaelwoerister
referenced this issue
Jul 17, 2013
Closed
Adapted `trans::common::{block, fn_ctxt, scope_info}` to new naming convention. #7848
bors
added a commit
that referenced
this issue
Jul 22, 2013
bors
added a commit
that referenced
this issue
Jul 23, 2013
michaelwoerister
referenced this issue
Jul 30, 2013
Closed
Freezing &mut only works for locals. #8124
This comment has been minimized.
This comment has been minimized.
|
accepted for feature-complete |
nikomatsakis
referenced this issue
Sep 12, 2013
Closed
borrow scopes should not always be lexical #6393
huonw
referenced this issue
Nov 10, 2013
Closed
Borrow check thinks that a method call starts before its parameters are evaluated #10397
ezyang
referenced this issue
Dec 16, 2013
Closed
Borrow checker is sensitive to the order of borrows in surprising ways #10999
This comment has been minimized.
This comment has been minimized.
|
This can be added backwards-compatibly. Its a nice enhancement but not known to be a major problem to work-around. P-low, not 1.0. |
pnkfelix
added
P-low
and removed
P-high-untriaged
labels
Mar 20, 2014
zwarich
referenced this issue
May 26, 2014
Closed
Prevent reads via original path of mutably borrowed content #12624
zwarich
referenced this issue
Jun 18, 2014
Closed
Can't pass a POD field by value to a &mut self method #15021
This comment has been minimized.
This comment has been minimized.
|
By the way, the reason that this does not type check under our current model is provided in the internal docs for the type checker; see: typeck/infer/region_inference/doc.rs lines 171 through 262. |
huonw
referenced this issue
Jul 1, 2014
Closed
Explicitly define the evaluation order/"sequence points" etc. #15300
pcwalton
referenced this issue
Aug 20, 2014
Closed
Lifetime of reference taken for parameter vs lifetime of function resolution #16627
P1start
referenced this issue
Sep 18, 2014
Closed
Parameter borrows should happen before receiver borrows #17365
This comment has been minimized.
This comment has been minimized.
|
Triage bump; still an issue. |
This comment has been minimized.
This comment has been minimized.
|
cc me, I still hit this with surprising regularity. |
pnkfelix
referenced this issue
Apr 16, 2015
Closed
Non-lexical borrow scopes and better treatment of nested method calls #811
This comment has been minimized.
This comment has been minimized.
|
Closing in favor of rust-lang/rfcs#811 |
nikomatsakis
closed this
Apr 16, 2015
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Jun 12, 2015
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Jun 12, 2015
This comment has been minimized.
This comment has been minimized.
dcsommer
commented
Jul 21, 2015
|
Seems to be a blocker for some async IO patterns needed for lowest-latency processing. cc me. |
nikomatsakis commentedMay 6, 2013
This is challenging to resolve. I thought I could fit into the new borrow checker, but it is worth addressing separately since there are a number of subtle issues. What this really amounts to is that you need to support borrows where the lifetime of the borrow pointer does not encompass the borrow itself. To handle this safely, we wind up with two loans, the primary one and then a secondary, aliasing loan that tracks the fact that a pointer has been created, even if the memory it points at cannot be dereferenced yet.
Part of #5074