Skip to content

Wrong code with assignment in match body #26996

Closed
@eefriedman

Description

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

Metadata

Metadata

Assignees

Labels

A-codegenArea: Code generation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions