about summary refs log tree commit diff
path: root/src/rt/rust_exchange_alloc.cpp
diff options
context:
space:
mode:
authorStepan Koltsov <stepan.koltsov@gmail.com>2013-08-07 22:07:24 +0400
committerStepan Koltsov <stepan.koltsov@gmail.com>2013-08-07 22:07:24 +0400
commit828bfb2c61aaac93325b00737362769d045b6438 (patch)
treedbe318e98a06cc74b166f3c3e2f19b56984582e8 /src/rt/rust_exchange_alloc.cpp
parent29ffbbaaa850d3f8fe1b35e3a63defe9206a3eb7 (diff)
downloadrust-828bfb2c61aaac93325b00737362769d045b6438.tar.gz
rust-828bfb2c61aaac93325b00737362769d045b6438.zip
Fix incorrect non-exhaustive matching for fixed length vecs
Code like this is fixed now:

```
fn foo(p: [u8, ..4]) {
    match p {
        [a, b, c, d] => {}
    };
}
```

Invalid constructors are not reported as errors yet:

```
fn foo(p: [u8, ..4]) {
    match p {
        [_, _, _] => {} // this should be error
        [_, _, _, _, _, .._] => {} // and this
        _ => {}
    }
}
```

Issue #8311 is partially fixed by this commit. Fixed-length arrays in
let statement are not yet allowed:

```
let [a, b, c] = [1, 2, 3]; // still fails
```
Diffstat (limited to 'src/rt/rust_exchange_alloc.cpp')
0 files changed, 0 insertions, 0 deletions