Skip to content
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

Slice patterns don't work well with ref mut #42291

Closed
clarfonthey opened this issue May 29, 2017 · 2 comments · Fixed by #51894
Closed

Slice patterns don't work well with ref mut #42291

clarfonthey opened this issue May 29, 2017 · 2 comments · Fixed by #51894
Labels
A-slice-patterns Area: Slice patterns, https://github.com/rust-lang/rust/issues/23121 C-bug Category: This is a bug.

Comments

@clarfonthey
Copy link
Contributor

Minimal example: https://is.gd/40m1am

#![feature(slice_patterns)]
fn main() {
    let mut buf = [0, 1];
    let [ref mut a, ref mut b] = buf;
}

This will complain about multiple mutable borrows, even though it should be valid.

@Stebalien
Copy link
Contributor

Noted in #8636 (comment) (but may deserve a separate bug report?).

(FYI, slice patterns are unstable for a reason; they're pretty buggy at the moment).

@Mark-Simulacrum Mark-Simulacrum added the A-slice-patterns Area: Slice patterns, https://github.com/rust-lang/rust/issues/23121 label Jun 23, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 27, 2017
bors added a commit that referenced this issue Jul 6, 2018
@mikhail-m1
Copy link
Contributor

should be closed after MIR borrowck will be by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-slice-patterns Area: Slice patterns, https://github.com/rust-lang/rust/issues/23121 C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants