We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26e2360 commit cd59848Copy full SHA for cd59848
compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs
@@ -186,7 +186,13 @@ impl<'tcx> InherentCollect<'tcx> {
186
return;
187
};
188
189
- let self_ty = self.tcx.type_of(item.owner_id);
+ let mut self_ty = self.tcx.type_of(item.owner_id);
190
+ if matches!(self_ty.kind(), ty::Alias(ty::AliasKind::Projection, _)) {
191
+ let param_env = self.tcx.param_env(item.owner_id);
192
+ if let Ok(new_ty) = self.tcx.try_normalize_erasing_regions(param_env, self_ty) {
193
+ self_ty = new_ty;
194
+ }
195
196
match *self_ty.kind() {
197
ty::Adt(def, _) => {
198
self.check_def_id(item, self_ty, def.did());
0 commit comments