rust/crates/ra_hir/src
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
..
code_model_impl rename ModuleId -> CrateModuleId 2019-03-17 12:53:22 +03:00
expr rename scopes 2019-03-02 16:38:28 +03:00
nameres remove fixme 2019-03-17 12:53:22 +03:00
ty Merge #982 2019-03-17 21:41:37 +00:00
adt.rs Remove TypeRef from item opts which implement TypeAscriptionOwner 2019-02-27 14:08:09 +02:00
code_model_api.rs rename ModuleId -> CrateModuleId 2019-03-17 12:53:22 +03:00
code_model_impl.rs Add const type inference 2019-02-25 10:51:46 +02:00
db.rs remove old macro support 2019-03-17 12:53:22 +03:00
docs.rs Make doc comments optional 2019-01-26 10:35:23 -05:00
expr.rs remove comment 2019-03-02 17:01:20 +03:00
generics.rs Rename Type => TypeAlias 2019-02-24 21:36:49 +01:00
ids.rs remove old macro support 2019-03-17 12:53:22 +03:00
impl_block.rs remove lower module 2019-03-17 12:52:52 +03:00
lib.rs remove old macro support 2019-03-17 12:53:22 +03:00
marks.rs Merge #982 2019-03-17 21:41:37 +00:00
mock.rs Make edition handling a bit nicer and allow specifying edition in crate_graph macro 2019-02-13 20:31:47 +01:00
module_tree.rs Replace module_tree with CrateDefMap 2019-03-17 12:49:07 +03:00
name.rs add skeleton for macro-aware name resolutions 2019-03-17 12:46:13 +03:00
nameres.rs docs 2019-03-17 12:53:22 +03:00
path.rs Make GenericArgs::from_ast pub(crate) 2019-02-17 14:55:04 +01:00
resolve.rs rename ModuleId -> CrateModuleId 2019-03-17 12:53:22 +03:00
source_binder.rs remove lower module 2019-03-17 12:52:52 +03:00
ty.rs Remove FnSig from FnDef type 2019-03-16 17:29:55 +01:00
type_alias.rs Rename Type => TypeAlias 2019-02-24 21:36:49 +01:00
type_ref.rs Remove TypeRef from item opts which implement TypeAscriptionOwner 2019-02-27 14:08:09 +02:00