@@ -263,17 +263,17 @@ void
263
263
ASTLowerPathInExpression::visit (AST::PathInExpression &expr)
264
264
{
265
265
std::vector<HIR::PathExprSegment> path_segments;
266
- expr.iterate_path_segments ([&] (AST::PathExprSegment &s) mutable -> bool {
267
- path_segments.push_back (lower_path_expr_seg (s));
268
-
269
- // insert the mappings for the segment
270
- HIR::PathExprSegment *lowered_seg = &path_segments.back ();
271
- mappings->insert_hir_path_expr_seg (
272
- lowered_seg->get_mappings ().get_crate_num (),
273
- lowered_seg->get_mappings ().get_hirid (), lowered_seg);
274
- return true ;
275
- });
266
+ auto &segments = expr.get_segments ();
267
+ for (auto &s : segments)
268
+ {
269
+ path_segments.push_back (lower_path_expr_seg ((s)));
276
270
271
+ // insert the mappings for the segment
272
+ HIR::PathExprSegment *lowered_seg = &path_segments.back ();
273
+ mappings->insert_hir_path_expr_seg (
274
+ lowered_seg->get_mappings ().get_crate_num (),
275
+ lowered_seg->get_mappings ().get_hirid (), lowered_seg);
276
+ }
277
277
auto crate_num = mappings->get_current_crate ();
278
278
Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
279
279
mappings->get_next_hir_id (crate_num),
@@ -311,16 +311,17 @@ ASTLowerQualPathInExpression::visit (AST::QualifiedPathInExpression &expr)
311
311
= lower_qual_path_type (expr.get_qualified_path_type ());
312
312
313
313
std::vector<HIR::PathExprSegment> path_segments;
314
- expr.iterate_path_segments ([&] (AST::PathExprSegment &s) mutable -> bool {
315
- path_segments.push_back (lower_path_expr_seg (s));
316
-
317
- // insert the mappings for the segment
318
- HIR::PathExprSegment *lowered_seg = &path_segments.back ();
319
- mappings->insert_hir_path_expr_seg (
320
- lowered_seg->get_mappings ().get_crate_num (),
321
- lowered_seg->get_mappings ().get_hirid (), lowered_seg);
322
- return true ;
323
- });
314
+ auto &segments = expr.get_segments ();
315
+ for (auto &s : segments)
316
+ {
317
+ path_segments.push_back (lower_path_expr_seg ((s)));
318
+
319
+ // insert the mappings for the segment
320
+ HIR::PathExprSegment *lowered_seg = &path_segments.back ();
321
+ mappings->insert_hir_path_expr_seg (
322
+ lowered_seg->get_mappings ().get_crate_num (),
323
+ lowered_seg->get_mappings ().get_hirid (), lowered_seg);
324
+ }
324
325
325
326
auto crate_num = mappings->get_current_crate ();
326
327
Analysis::NodeMapping mapping (crate_num, expr.get_node_id (),
0 commit comments