diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 5b99cd1e264..c6607eff90d 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -1932,7 +1932,7 @@ fn is_self_ty(&self, ty: &Ty) -> bool { if let Some(Res::SelfTyParam { .. } | Res::SelfTyAlias { .. }) = path_res { return true; } - path_res == self.impl_self + self.impl_self.is_some() && path_res == self.impl_self } _ => false, }