Closed
Description
Binding a match arm using "as-patterns" ref x @
or ref mut x @
will emit an incorrect error message.
rusti: match Some(1) { ref x@Some(*) => 1, None => 0 }
<anon>:5:10: 5:57 error: non-exhaustive patterns
<anon>:5 match Some(1) { ref x@Some(*) => 1, None => 0 }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rustc will be silent and happy if a third case _ => fail!()
is provided.