-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arithmetic makes borrow checker overly restrictive #29743
Comments
@rust-lang/lang, is this behavior expected? I wonder if there's something weird going on here |
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. |
triage: P-medium |
Likely to be fixed by MIR, though. |
Still reproduces. |
(Note: would be fixed by a MIR-based borrowck is what I meant, which is not yet done.) |
Still seems to be a problem on rustc 1.23.0-nightly (8b22e70 2017-10-31) - not sure if expected ?
|
Hmm MIR-borrowck does not seem to address this case, at least not out-of-the-box |
The first question is to decide, I suppose, what the expected behavior is =) |
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. |
Well, based on this play test case, we do not get consistent behavior. |
I wonder if #47167 will affect this, actually. |
Seems like #47167 fixes it. |
It now works on nightly. Marking as E-needstest. Removing from WG-compiler-nll, since this was not specific to NLL in any way. |
UPDATE: This was fixed by #47167 but still needs a regression test to be added.
I had expect the
- 1
not to make any difference, but the borrow checker complains with the following error:The text was updated successfully, but these errors were encountered: