Files
rust/compiler/rustc_middle
Guillaume Gomez 66ce7b0106 Rollup merge of #156845 - onehr:clarify-cyclic-type-149842, r=JohnTitor
Clarify "infinite size" in cyclic-type diagnostic refers to the type name

Closes rust-lang/rust#149842

The `TypeError::CyclicTy` diagnostic currently emits
"cyclic type of infinite size". As discussed in the issue, "infinite
size" reads as the in-memory `size_of::<T>()` of values, when it
actually refers to the textual representation of the type name (an
iso-recursive occurs-check failure).

This rewords the message so the qualifier "infinite-size" clearly
modifies the *name*, matching the direction `@fmease`, `@BoxyUwU`,
and the issue author converged on:

```
- cyclic type of infinite size
+ recursive type with infinite-size name
```

Nine existing UI `.stderr` baselines and two `//~ NOTE` annotations
are updated to track the new wording. No semantics change.

Tested:
- ./x test tests/ui/const-generics/occurs-check/ tests/ui/closures/ tests/ui/unboxed-closures/ tests/ui/typeck/ tests/ui/coroutine/ --force-rerun
- ./x test tidy
2026-05-27 20:45:12 +02:00
..
2026-04-08 21:09:07 +02:00

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