]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_ast_lowering/src/index.rs
Rollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwco
[rust.git] / compiler / rustc_ast_lowering / src / index.rs
index 219e1b81d1ea64d3226d9eb93787b1ed2d98fe4d..61470d93bdb2c3bb3411c5b4a78c54a346bcb4ea 100644 (file)
@@ -246,9 +246,7 @@ fn visit_stmt(&mut self, stmt: &'hir Stmt<'hir>) {
     }
 
     fn visit_path_segment(&mut self, path_span: Span, path_segment: &'hir PathSegment<'hir>) {
-        if let Some(hir_id) = path_segment.hir_id {
-            self.insert(path_span, hir_id, Node::PathSegment(path_segment));
-        }
+        self.insert(path_span, path_segment.hir_id, Node::PathSegment(path_segment));
         intravisit::walk_path_segment(self, path_span, path_segment);
     }