diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-17 21:41:37 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-03-17 21:41:37 +0000 |
commit | 40c6dd1f4c57d6a8ec26c1bdef24753c884c38aa (patch) | |
tree | cf9959b252a7c9e25c4e186b57f92ff9d6bec61d /crates/ra_ide_api/src/call_info.rs | |
parent | 91e7a3b6f2a9f1a09f874e9644491898338a842f (diff) | |
parent | 6299ccd350c190003c51aa68f48b1edfb1a497b1 (diff) |
Merge #982
982: Implement BindingMode for pattern matching. r=flodiebold a=mjkillough
Implement `BindingMode` for pattern matching, so that types can be
correctly inferred using match ergonomics. The binding mode defaults to
`Move` (referred to as 'BindingMode::BindByValue` in rustc), and is
updated by automatic dereferencing of the value being matched.
Fixes #888.
- [Binding modes in The Reference](https://doc.rust-lang.org/reference/patterns.html#binding-modes)
- [`rustc` implementation](https://github.com/rust-lang/rust/blob/e17c48e2f21eefd59748e364234efc7037a3ec96/src/librustc_typeck/check/_match.rs#L77) (and [definition of `BindingMode`](https://github.com/rust-lang/rust/blob/e957ed9d10ec589bdd523b88b4b44c41b1ecf763/src/librustc/ty/binding.rs))
- [Match Ergonomics RFC](https://github.com/rust-lang/rfcs/blob/master/text/2005-match-ergonomics.md#binding-mode-rules)
Co-authored-by: Michael Killough <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/call_info.rs')
0 files changed, 0 insertions, 0 deletions