rust-lang / rust-lang/rust

Overflow evaluating well-formedness requirement with empty trait bound on associated type

Open
#148,349 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-coinduction A-trait-system C-bug P-high regression-from-stable-to-stable S-has-bisection T-types
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

rustc 1.91.0 as well as nightly (1.93.0-nightly (2025-10-30 d5419f1e97b90741d518)) produce an overflow error when using a where clause on an associated type when the bound in the where clause is empty. While this is a pathological example, this did occur in auto-generated code (e.g. in verus).

trait SomeBound {}

trait T where
    Self::Assoc:,
    // this works:
    //Self::Assoc: SomeBound
{
    type Assoc;
}

Playground link

I expected this to compile successfully (and indeed it did on Rust 1.88).

On nightly and with 1.91 (rustc 1.91.0 (f8297e351 2025-10-28)), I get the following error:

   Compiling playground v0.0.1 (/playground)
error[E0275]: overflow evaluating the requirement `<Self as T>::Assoc well-formed`
 --> src/lib.rs:4:5
  |
4 |     Self::Assoc:,
  |     ^^^^^^^^^^^
  |
note: required by a bound in `T`
 --> src/lib.rs:4:5
  |
3 | trait T where
  |       - required by a bound in this trait
4 |     Self::Assoc:,
  |     ^^^^^^^^^^^ required by this bound in `T`

For more information about this error, try `rustc --explain E0275`.
error: could not compile `playground` (lib) due to 1 previous error

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Playground reproducer and compare Rust 1.88, 1.91, and nightly using the example at src/lib.rs:4. Investigate the well-formedness overflow triggered by the empty associated-type bound; done means the minimal example compiles again while the non-empty bound continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.