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 upArithmetic makes borrow checker overly restrictive #29743
Comments
steveklabnik
added
the
A-lang
label
Nov 11, 2015
This comment has been minimized.
This comment has been minimized.
|
@rust-lang/lang, is this behavior expected? I wonder if there's something weird going on here |
This comment has been minimized.
This comment has been minimized.
|
Does seem odd. I suspect that the borrow checker is (incorrectly) still locked into the days when indices were passed by reference, rather than by value. |
This comment has been minimized.
This comment has been minimized.
|
triage: P-medium |
rust-highfive
added
the
P-medium
label
Nov 12, 2015
nikomatsakis
added
the
T-lang
label
Nov 12, 2015
This comment has been minimized.
This comment has been minimized.
|
Likely to be fixed by MIR, though. |
This comment has been minimized.
This comment has been minimized.
|
Still reproduces. |
This comment has been minimized.
This comment has been minimized.
|
(Note: would be fixed by a MIR-based borrowck is what I meant, which is not yet done.) |
brson
added
I-wrong
E-hard
labels
Aug 4, 2016
nikomatsakis
added
the
A-borrow-checker
label
Aug 4, 2016
steveklabnik
removed
the
A-lang
label
Mar 24, 2017
Mark-Simulacrum
added
C-bug
and removed
I-wrong
labels
Jul 24, 2017
This comment has been minimized.
This comment has been minimized.
|
Still seems to be a problem on rustc 1.23.0-nightly (8b22e70 2017-10-31) - not sure if expected ?
|
This comment has been minimized.
This comment has been minimized.
|
Hmm MIR-borrowck does not seem to address this case, at least not out-of-the-box |
pnkfelix
added
A-NLL
WG-compiler-nll
labels
Dec 21, 2017
This comment has been minimized.
This comment has been minimized.
|
The first question is to decide, I suppose, what the expected behavior is =) |
This comment has been minimized.
This comment has been minimized.
|
In other words, I think I would expect consistent behavior, but I could see how this might wind up as an error in both cases. |
This comment has been minimized.
This comment has been minimized.
|
Well, based on this play test case, we do not get consistent behavior. |
This comment has been minimized.
This comment has been minimized.
|
I wonder if #47167 will affect this, actually. |
This comment has been minimized.
This comment has been minimized.
|
Seems like #47167 fixes it. |
This comment has been minimized.
This comment has been minimized.
|
It now works on nightly. Marking as E-needstest. Removing from WG-compiler-nll, since this was not specific to NLL in any way. |
dotdash commentedNov 10, 2015
•
edited by nikomatsakis
UPDATE: This was fixed by #47167 but still needs a regression test to be added.
I had expect the
- 1not to make any difference, but the borrow checker complains with the following error: