mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-05 07:26:48 +00:00
Always record reference to binding in match if guards When encountering a binding from a `match` pattern in its `if` guard when computing a generator's interior types, we must always record the type of a reference to the binding because of how `if` guards are lowered to MIR. This was missed in #75213 because the binding in that test case was autorefed and we recorded that adjusted type anyway. Fixes #78366
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.