rust-analyzer/crates/hir-ty
bors 07f6efc4e7 Auto merge of #13523 - lowr:fix/adjust-expectation-for-if, r=lnicola
fix: disregard type variable expectation for if expressions

Fixes #13522

As [the comment](8142d1f606/crates/hir-ty/src/infer.rs (L1087-L1090)) on `Expectation::adjust_for_branches` explains:

> If the expected type is just a type variable, then don't use an expected type. Otherwise, we might write parts of the type when checking the 'then' block which are incompatible with the 'else' branch.

Note that we already use it in match expressions. I've added tests for them too nevertheless.
2022-10-31 15:39:20 +00:00
..
src Auto merge of #13523 - lowr:fix/adjust-expectation-for-if, r=lnicola 2022-10-31 15:39:20 +00:00
Cargo.toml Auto merge of #13408 - lowr:patch/bump-chalk-0.86, r=Veykril 2022-10-16 10:57:23 +00:00