Files
rust/compiler/rustc_middle
Jonathan Brouwer 3f1ddd5788 Rollup merge of #147834 - WaffleLapkin:tuple-coerce, r=BoxyUwU
Always make tuple elements a coercion site

Previously we only used `check_expr_coercible_to_type` if we had an expectation (using `check_expr_with_expectation(NoExpectation)` otherwise). Normally that'd be fine, because without an expectation we can't insert a coercion anyway. However, for the case of never-to-any coercion specifically, we _do_ insert it eagerly, so this prevents some code from compiling, for example:

```rust
((),) = (loop {},);
```

With this PR we are always using `check_expr_coercible_to_type` (using an infer var if there is no expectation), which allows slightly more code to compile.

Fixes rust-lang/rust#112856

r? BoxyUwU
2026-03-09 17:56:14 +01:00
..

For more information about how rustc works, see the rustc dev guide.