]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #68856 - Centril:or-pat-ref-pat, r=matthewjasper
authorYuki Okushi <huyuumi.dev@gmail.com>
Fri, 14 Feb 2020 22:17:47 +0000 (07:17 +0900)
committerGitHub <noreply@github.com>
Fri, 14 Feb 2020 22:17:47 +0000 (07:17 +0900)
commit829a3635e45f59546e9b5ac0716ea9e0c694456c
tree4daa78b251fd99934bfcd4144a4d36f281234819
parent2c5bdee9e4a750355c99a1fbed57b20ba953766b
parentb5aca3128d5c0ee2441ec9ca9a9c3ae4f391ef16
Rollup merge of #68856 - Centril:or-pat-ref-pat, r=matthewjasper

typeck: clarify def_bm adjustments & add tests for or-patterns

Clarify the adjustment algorithm for the expected type / default binding-modes when type checking patterns with more documentation and tweaks that make the algorithm more independent of the pattern forms.

Also resolve the FIXME noted for or-patterns by deciding that the current implementation is correct, noting the rationale and adding tests for the current implementation.

cc https://github.com/rust-lang/rust/issues/54883

r? @oli-obk @varkor
src/librustc_typeck/check/pat.rs