Skip to content

Commit

Permalink
Rollup merge of #121258 - fmease:assoc-const-eq-reject-overly-generic…
Browse files Browse the repository at this point in the history
…-tys, r=compiler-errors

Reject overly generic assoc const binding types

Split off from #119385 to make #119385 easier to review.

---

In the *instantiated* type of assoc const bindings

1. reject **early-bound generic params**
   * Provide a rich error message instead of ICE'ing ([#108271](rust-lang/rust#108271)).
   * This is a temporary and semi-artificial restriction until the arrival of *generic const generics*.
   * It's quite possible that rustc could already perfectly support this subset of generic const generics if we just removed some checks (some `.no_bound_vars().expect(…)`) but even if that was the case, I'd rather gate it behind a new feature flag. Reporting an error instead of ICE'ing is a good first step towards an eventual feature gate error.
2. reject **escaping late-bound generic params**
   * They lead to ICEs before & I'm pretty sure that they remain incorrect even in a world with *generic const generics*

---

Together with #118668 & #119385, this supersedes #118360.
Fixes #108271.
  • Loading branch information
matthiaskrgr authored Mar 18, 2024
2 parents 5ca3ad8 + bb9088a commit 82a9a28
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 82a9a28

Please sign in to comment.