typeck: clarify def_bm adjustments & add tests for or-patterns by Centril · Pull Request #68856 · rust-lang/rust (original) (raw)

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 #54883

r? @oli-obk @varkor