Skip to content

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

Closed
@clarfonthey

Description

@clarfonthey

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-slice-patternsArea: Slice patterns, https://github.com/rust-lang/rust/issues/23121C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions