Skip to content

Commit fd7358a

Browse files
powerboat9CohenArthur
authored andcommitted
gccrs: Improve GroupedPattern lowering
gcc/rust/ChangeLog: * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::visit): Lower AST::GroupedPattern to its inner pattern. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
1 parent 2dab57c commit fd7358a

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

gcc/rust/hir/rust-ast-lower-pattern.cc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -246,17 +246,7 @@ ASTLoweringPattern::visit (AST::RangePattern &pattern)
246246
void
247247
ASTLoweringPattern::visit (AST::GroupedPattern &pattern)
248248
{
249-
auto crate_num = mappings->get_current_crate ();
250-
Analysis::NodeMapping mapping (crate_num, pattern.get_node_id (),
251-
mappings->get_next_hir_id (crate_num),
252-
UNKNOWN_LOCAL_DEFID);
253-
254-
HIR::Pattern *inner
255-
= ASTLoweringPattern::translate (pattern.get_pattern_in_parens ().get ());
256-
257-
translated
258-
= new HIR::GroupedPattern (mapping, std::unique_ptr<HIR::Pattern> (inner),
259-
pattern.get_locus ());
249+
pattern.get_pattern_in_parens ()->accept_vis (*this);
260250
}
261251

262252
} // namespace HIR

0 commit comments

Comments
 (0)