about summary refs log tree commit diff
path: root/compiler/rustc_resolve/src
diff options
context:
space:
mode:
authorTakayuki Maeda <takoyaki0316@gmail.com>2022-10-20 14:10:52 +0900
committerTakayuki Maeda <takoyaki0316@gmail.com>2022-10-20 14:10:52 +0900
commit9a9e2fe15fd0a730e929db88fcf73b0cb3a99ddc (patch)
treef4c6b22808151f945c98d5a22492083de7cb8a5e /compiler/rustc_resolve/src
parent0b2716415f1bd26e80887c2d8459fd436fc8e9b3 (diff)
downloadrust-9a9e2fe15fd0a730e929db88fcf73b0cb3a99ddc.tar.gz
rust-9a9e2fe15fd0a730e929db88fcf73b0cb3a99ddc.zip
check if impl_self is `Some`
Diffstat (limited to 'compiler/rustc_resolve/src')
-rw-r--r--compiler/rustc_resolve/src/late.rs2
1 files changed, 1 insertions, 1 deletions
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 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
                         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,
                 }