SIGN IN SIGN UP
rust-lang / rust UNCLAIMED

Empowering everyone to build reliable and efficient software.

0 0 71 Rust

Auto merge of #149728 - mu001999-contrib:fix/149695, r=jdonszelmann

Emit ForbiddenBound fatally if meeting complex bound



Fixes https://github.com/rust-lang/rust/issues/149695

---

Bounds in binders are denied, hir items won't contain and index them. But nested items in the bounds will still be lowered to hir. And their parents, i.e., the block in bounds is not in hir. So that ICE happens when error handling requires visiting hir parents.

~~This PR collects hirless def ids and skips them when iterating parents.~~

~~This PR checks such bounds used in higher ranked binders and emit error `ForbiddenBound` when parsing. And make sure no such bounds appear in hir.~~

This PR emits this error fatally if meeting complex bound.
B
bors committed
91021ccc790478a1a89c003e7d32b8d155ae6aae