diff options
| author | Jakub Bukaj <jakub@jakub.cc> | 2014-11-20 16:57:36 +0100 |
|---|---|---|
| committer | Jakub Bukaj <jakub@jakub.cc> | 2014-11-26 22:21:52 +0000 |
| commit | 5804a306868aee5ff0a3d7829db7924978317f0e (patch) | |
| tree | f269799695b88cd0d00df02549ad77bfa7faf5b1 /src/rustllvm/RustWrapper.cpp | |
| parent | 6faff24ec85744de092a7d7c2378370f65d623bb (diff) | |
| download | rust-5804a306868aee5ff0a3d7829db7924978317f0e.tar.gz rust-5804a306868aee5ff0a3d7829db7924978317f0e.zip | |
Warn on pattern bindings that have the same name as a variant
...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.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
