rust-analyzer/crates/ra_hir/src/ty
bors[bot] 40c6dd1f4c 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](e17c48e2f2/src/librustc_typeck/check/_match.rs (L77)) (and [definition of `BindingMode`](e957ed9d10/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 <michaeljkillough@gmail.com>
2019-03-17 21:41:37 +00:00
..
autoderef.rs Fix typos in ARCHITECTURE.md and a number of crates 2019-01-09 01:17:09 +01:00
display.rs Replace Display by a pretty printing trait for Ty 2019-03-16 16:36:59 +01:00
infer.rs Merge #982 2019-03-17 21:41:37 +00:00
lower.rs Remove FnSig from FnDef type 2019-03-16 17:29:55 +01:00
method_resolution.rs rename ModuleId -> CrateModuleId 2019-03-17 12:53:22 +03:00
op.rs Split ty.rs into several modules 2019-02-23 15:36:38 +01:00
primitive.rs Some more Ty displaying cleanup 2019-03-16 16:50:31 +01:00
tests.rs Merge #982 2019-03-17 21:41:37 +00:00