Skip to content

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

@dschoepe

Description

@dschoepe

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-coinductionArea: Concerning coinduction, most often for auto traitsA-trait-systemArea: Trait systemC-bugCategory: This is a bug.P-highHigh priorityS-has-bisectionStatus: A bisection has been found for this issueT-typesRelevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions