Open
Description
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
Metadata
Metadata
Assignees
Labels
Area: Trait systemCategory: This is a bug.Nominated for discussion during a types team meeting.High priorityStatus: A bisection has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.Performance or correctness regression from stable to beta.