diff options
| author | bors <bors@rust-lang.org> | 2013-08-08 21:41:05 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-08 21:41:05 -0700 |
| commit | a931e04b757a795e3867ea98c81cee731bd54ac1 (patch) | |
| tree | b771c4bd5b7bb4aa0c70b92a4f8245f446cc4e24 /src/rustllvm/RustWrapper.cpp | |
| parent | 7a1b61d6317c27b735e5471d3d704584bea4c925 (diff) | |
| parent | 0fadfc5fb7de47f0ffcb55a8bbfe0a75c2a4dbee (diff) | |
| download | rust-a931e04b757a795e3867ea98c81cee731bd54ac1.tar.gz rust-a931e04b757a795e3867ea98c81cee731bd54ac1.zip | |
auto merge of #8350 : dim-an/rust/fix-struct-match, r=pcwalton
Code that collects fields in struct-like patterns used to ignore
wildcard patterns like `Foo{_}`. But `enter_defaults` considered
struct-like patterns as default in order to overcome this
(accoring to my understanding of situation).
However such behaviour caused code like this:
```
enum E {
Foo{f: int},
Bar
}
let e = Bar;
match e {
Foo{f: _f} => { /* do something (1) */ }
_ => { /* do something (2) */ }
}
```
consider pattern `Foo{f: _f}` as default. That caused inproper behaviour
and even segfaults while trying to destruct `Bar` as `Foo{f: _f}`.
Issues: #5625 , #5530.
This patch fixes `collect_record_or_struct_fields` to split cases of
single wildcard struct-like pattern and no struct-like pattern at all.
Former case resolved with `enter_rec_or_struct` (and not with
`enter_defaults`).
Closes #5625.
Closes #5530.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
