Skip to content

where bounds regression in beta+nightly #143992

Closed

Description

@mejrs

Code

pub trait Trait {
    type Assoc<G>: OtherTrait<G>;
}

pub trait OtherTrait<R> {
    fn new(r: R) -> R {
        r
    }
}

pub fn function<T: Trait>()
where
    T::Assoc<[u32; 1]>: Clone, // comment out to let it compile
{
    let _x = T::Assoc::new(());
}

Version it worked on

It most recently worked on: Stable (1.88)

Version with regression

Beta (1.89), nightly (1.90) produces

   Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
  --> src/lib.rs:15:28
   |
15 |     let _x = T::Assoc::new(());
   |              ------------- ^^ expected `[u32; 1]`, found `()`
   |              |
   |              arguments to this function are incorrect
   |
note: associated function defined here
  --> src/lib.rs:6:8
   |
6  |     fn new(r: R) -> R {
   |        ^^^ ----

For more information about this error, try `rustc --explain E0308`.

Originally found in https://github.com/phimuemue/openschafkopf/blob/dacfecc50338443955998a074c0901d989b7a553/lib/src/game_analysis/determine_best_card_table.rs#L51

error[E0308]: mismatched types
  --> lib/src/game_analysis/determine_best_card_table.rs:70:9
   |
70 | /         SFormatInfo {
71 | |             f_min: f32::MAX,
72 | |             f_max: f32::MIN,
73 | |             n_width: 0,
74 | |         };
   | |_________^ expected `(String, f32)`, found `SFormatInfo`
   |
   = note: expected tuple `(std::string::String, f32)`
             found struct `SFormatInfo`

@rustbot modify labels: +regression-from-stable-to-beta +regression-from-stable-to-nightly -regression-untriaged

Activity

  1. added
    C-bugCategory: This is a bug.
    regression-untriagedUntriaged performance or correctness regression.
    on Jul 15, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    and removed
    regression-untriagedUntriaged performance or correctness regression.
    on Jul 15, 2025
  3. fmease commented on Jul 15, 2025

    @fmease
  4. added
    S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue
    on Jul 15, 2025
  5. fmease commented on Jul 15, 2025

    @fmease
  6. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    T-typesRelevant to the types team, which will review and decide on the PR/issue.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jul 15, 2025
  7. fmease commented on Jul 15, 2025

    @fmease
    Member

    (I wager it's due to #137944 — Sized Hierarchy — which came with brittle elaboration optimizations but I could be wrong)

  8. added
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    on Jul 15, 2025
  9. 18 remaining items

  10. added 2 commits that reference this issue on Oct 15, 2025
    27c2465
    57ef8d6
  11. added a commit that references this issue on Oct 16, 2025
    44c9af8
  12. added a commit that references this issue on Oct 18, 2025
    41f1677
  13. added a commit that references this issue on Nov 30, 2025
    dfc23a4
  14. added a commit that references this issue on Dec 29, 2025
    cab7e7d
  15. removed
    I-types-nominatedNominated for discussion during a types team meeting.
    on Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemC-bugCategory: This is a bug.F-sized_hierarchy`#![feature(sized_hierarchy)]`P-highHigh priorityS-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions