40c6dd1f4c
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>
13 lines
295 B
Rust
13 lines
295 B
Rust
test_utils::marks!(
|
|
bogus_paths
|
|
name_res_works_for_broken_modules
|
|
can_import_enum_variant
|
|
type_var_cycles_resolve_completely
|
|
type_var_cycles_resolve_as_possible
|
|
type_var_resolves_to_int_var
|
|
glob_enum
|
|
glob_across_crates
|
|
std_prelude
|
|
match_ergonomics_ref
|
|
);
|