Change:
Hello After upgrading nightly rustc, I'm getting a lot of type inference errors on code that was compiling fine previously. Moreover, these are not at the call site, but at the definition site, so there doesn't seem to be any place to put any type annotations, like this: It spills more kinds of errors that make little sense, but I have the impression these will have a common cause: The problematic code is both released on (crate spirit, version 0.4.16, but I expect that to be happening through most of the history of the crate), and in master (). I think this is a regression, as it was compiling previously. It compiles fine with older nightly (and stable is fine way back, this particular code is looking mostly the same for some 2 years or more): Breaks with (Unfortunately, I haven't been keeping fully up to date recently, so I don't have a smaller range).
Bisected: searched nightlies: from nightly-2021-01-01 to nightly-2021-04-20 regressed nightly: nightly-2021-04-01 searched commits: from to regressed commit: <details<summarybisected with <a href=''cargo-bisect-rustc</av0.6.0</summaryHost triple: x86_64-unknown-linux-gnu Reproduce with: </detailsRegressed PR is , cc
An MCVE would be extremely helpful here.
ping icebreakers-cleanup-crew I've tried without success to reduce this, it's buried in layers of crates. Maybe one of you will have better luck.
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good "Cleanup ICE-breaking candidate". In case it's useful, here are some [instructions] for tackling these sorts of bugs. Maybe take a look? Thanks! <3 [instructions]: https://rustc-dev- cc
Reduced:
Assigning priority as discussed as part of the and removing . label -I-prioritize +P-high
I can try to look into this over the weekend.
So, a bit of info: We end up trying to prove . We end up with two candidates: and that both evaluate to okay. This is ambiguous and WF checking fails.
This regression now slipped into beta 1.53.0.

Discussion:
) => false, (ParamCandidate(other), ParamCandidate(victim)) => { <del> if other.value == victim.value && victim.constness == Constness::NotConst { </del> <ins> let value_same_except_bound_vars = other.value.skip_binder() == victim.value.skip_binder() && !other.value.skip_binder().has_escaping_bound_vars(); if value_same_except_bound_vars { // See issue #84398. In short, we can generate multiple ParamCandidates which are // the same except for unused bound vars. Just pick the one with the fewest bound vars // or the current one if tied (they should both evaluate to the same answer). This is // probably best characterized as a "hack", since we might prefer to just do our // best to *not* create essentially duplicate candidates in the first place. other.value.bound_vars().len() <= victim.value.bound_vars().len() } else if other.value == victim.value && victim.constness == Constness::NotConst { </ins> // Drop otherwise equivalent non-const candidates in favor of const candidates. true } else {

<ins> // check-pass pub trait Deserialize<'de>: Sized {} pub trait DeserializeOwned: for<'de> Deserialize<'de> {} pub trait Extensible { type Config; } // The `C` here generates a `C: Sized` candidate pub trait Installer<C> { fn init<B: Extensible<Config = C>>(&mut self) -> () where // This clause generates a `for<'de> C: Sized` candidate B::Config: DeserializeOwned, { } } fn main() {} </ins>