Skip to content

mut is accepted before constants in patterns #34047

Closed

Description

@petrochenkov

This compiles on stable/beta/nightly and C is resolved as a constant and not a new binding.

const C: u8 = 0;

fn main() {
    match 1u8 {
        mut C => {}
        _ => {}
    }
}

Activity

  1. durka commented on Jun 2, 2016

    @durka
    Contributor

    It doesn't match though: https://is.gd/ylHuUv

  2. hanna-kruppe commented on Jun 2, 2016

    @hanna-kruppe
    Contributor

    @durka The example matches on 1, while C is 0, so of course it doesn't match. Conversely, match 0u8 correctly takes the C arm, and the generated code looks good too. It seems the mut is simply ignored.

  3. added a commit that references this issue on Jun 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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