Open tamaroning opened 2 months ago
AST::IdentifierPattern should lower to HIR::PathPattern only when identifiers resolve to enum variants or structs. However, they always lower to HIR::IdentifierPattern which introduces a new binding.
AST::IdentifierPattern
HIR::PathPattern
HIR::IdentifierPattern
See https://doc.rust-lang.org/reference/patterns.html
I tried this code:
enum E { A, B, } use E::*; fn main() -> i32 { match E::B { A => 1, B => 2, } }
No response
The current behavior is...
$ echo $? 1
I expected to see...
$ echo $? 2
master
Glob imports do not seem to work correctly for enum variants.
Summary
AST::IdentifierPattern
should lower toHIR::PathPattern
only when identifiers resolve to enum variants or structs. However, they always lower toHIR::IdentifierPattern
which introduces a new binding.See https://doc.rust-lang.org/reference/patterns.html
Reproducer
I tried this code:
Does the code make use of any (1.49) nightly feature ?
Godbolt link
No response
Actual behavior
The current behavior is...
Expected behavior
I expected to see...
GCC Version
master