]> git.lizzy.rs Git - rust.git/commit
auto merge of #19115 : jakub-/rust/issue-19100, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 26 Nov 2014 22:37:06 +0000 (22:37 +0000)
committerbors <bors@rust-lang.org>
Wed, 26 Nov 2014 22:37:06 +0000 (22:37 +0000)
commitfac5a07679cac21a580badc84b755b8df0f975cf
treeae15b481ed531e4fae600c41ca41107f6ad3e279
parent6faff24ec85744de092a7d7c2378370f65d623bb
parent9d01db1966a3ab073691eb8e5203e36624b9f992
auto merge of #19115 : jakub-/rust/issue-19100, r=alexcrichton

...of the type being matched.

This change will result in a better diagnostic for code like the following:

```rust
enum Enum {
    Foo,
    Bar
}

fn f(x: Enum) {
    match x {
        Foo => (),
        Bar => ()
    }
}
```

which would currently simply fail with an unreachable pattern error
on the 2nd arm.

The user is advised to either use a qualified path in the patterns
or import the variants explicitly into the scope.