Change:
<!-- [31mICE[0m: Rustc '-Zincremental-verify-ich=yes -Cincremental=<dir-Cdebuginfo=2' 'error: internal compiler error: unexpected region encountered in variance inference: ReLateParam(DefId(0:22 ~ 4CE26EEF2326F71D6A2A2B20D320CA8739959CBFE29E1EDC8A012C82A71A1C39[9323]::{impl}::deserialize), BrNamed(DefId(0:27 ~ 4CE26EEF2326F71D6A2A2B20D320CA8739959CBFE29E1EDC8A012C82A71A1C39[9323]::Deserialize::deserialize::'), '))', 'error: internal compiler error: unexpected region encountered in variance inference: ReLateParam(DefId(0:22 ~ 4CE26EEF2326F71D6A2A2B20D320CA8739959CBFE29E1EDC8A012C82A71A1C39[9323]::{impl}::deserialize), BrNamed(DefId(0:27 ~ 4CE26EEF2326F71D6A2A2B20D320CA8739959CBFE29E1EDC8A012C82A71A1C39[9323]::Deserialize::deserialize::'), '))' File: --auto-reduced (treereduce-rust): &lt;details&lt;summary&lt;strongoriginal code&lt;/strong&lt;/summary&lt;poriginal: </p</detailsVersion information ` Command: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongProgram output</strong</summary<p</p</details<!-- query stack: note: compiler flags: -Z incremental-verify-ich=yes -C incremental=[REDACTED] -C debuginfo=2 [cratevariances] computing the variances for items in this crate [variancesof] computing the variances of [checkwellformed] checking that is well-formed [checkmodtype_wf] checking that types are well-formed in top-level module [analysis] running analysis passes on this crate --
cc
Minimized:

Discussion:
self.suggest_trait_fn_ty_for_impl_fn_infer(hir_id, Some(i)) { infer_replacements.push((a.span, suggested_ty.to_string())); <del> return suggested_ty; </del> <ins> return Ty::new_error_with_message( self.tcx(), a.span, suggested_ty.to_string(), ); </ins> } }

self.suggest_trait_fn_ty_for_impl_fn_infer(hir_id, None) { infer_replacements.push((output.span, suggested_ty.to_string())); <del> suggested_ty </del> <ins> Ty::new_error_with_message(self.tcx(), output.span, suggested_ty.to_string()) </ins> } else { visitor.visit_ty(output); self.ast_ty_to_ty(output)

<ins> trait Deserialize { fn deserialize(&self); } struct ArchivedVec<T>(T); impl<T> Deserialize for ArchivedVec<T> { fn deserialize(s: _) {} //~^ ERROR: `_` is not allowed within types on item signatures //~| ERROR: has a `&self` declaration in the trait, but not in the impl } fn main() {} </ins>

<ins> error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/method-argument-mismatch-variance-ice-119867.rs:8:23 | LL |     fn deserialize(s: _) {} |                       ^ not allowed in type signatures | help: try replacing `_` with the type in the corresponding trait method signature | LL |     fn deserialize(s: &ArchivedVec<T>) {} |                       ~~~~~~~~~~~~~~~ error[E0186]: method `deserialize` has a `&self` declaration in the trait, but not in the impl --> $DIR/method-argument-mismatch-variance-ice-119867.rs:8:5 | LL |     fn deserialize(&self); |     ---------------------- `&self` used in trait ... LL |     fn deserialize(s: _) {} |     ^^^^^^^^^^^^^^^^^^^^ expected `&self` in impl error: aborting due to 2 previous errors Some errors have detailed explanations: E0121, E0186. For more information about an error, try `rustc --explain E0121`. </ins>