diff options
| author | bors <bors@rust-lang.org> | 2014-12-23 18:01:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-12-23 18:01:22 +0000 |
| commit | d10642ef0f8976b9fb08500acdff84e3990815fa (patch) | |
| tree | 2e033ae0f1781402df8bb60b458f1f63b6c0432e /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 658529467d9d69ac9e09cacf98a6d61d781c2c76 (diff) | |
| parent | adabf4e63d6b1d33b045aa5078b12dec3693c574 (diff) | |
| download | rust-d10642ef0f8976b9fb08500acdff84e3990815fa.tar.gz rust-d10642ef0f8976b9fb08500acdff84e3990815fa.zip | |
auto merge of #20083 : eddyb/rust/fix-expectation, r=nikomatsakis
This fixes a few corner cases with expected type propagation, e.g.:
```rust
fn take_int_slice(_: &[int]) {}
take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
```
```rust
<anon>:2:28: 2:36 error: mismatched types: expected `[int]`, found `[int, ..2]`
<anon>:2 take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
^~~~~~~~
<anon>:2:46: 2:54 error: mismatched types: expected `[int]`, found `[int, ..2]`
<anon>:2 take_int_slice(&if 1 < 0 { [ 0, 1 ] } else { [ 0, 1 ] });
^~~~~~~~
```
Right now we unpack the expected `&[int]` and pass down `[int]`, forcing
rvalue expressions to take unsized types, which causes mismatch errors.
Instead, I replaced that expectation with a weaker hint, for the unsized
cases - a hint is still required to infer the integer literals' types, above.
Fixes #20169.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
