Skip to content

Wrong code with assignment in match body, part 2 #27021

Closed
@eefriedman

Description

@eefriedman
fn main() {
    let mut c = (1, (1, "".to_owned()));
    match c {
        c2 => { (c.1).0 = 2; assert_eq!((c2.1).0, 1); }
    }
}
thread '<main>' panicked at 'assertion failed: `(left == right)` (left: `2`, right: `1`)', <anon>:4

CC @dotdash .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions