File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -848,18 +848,18 @@ class StructPattern : public Pattern
848
848
// bool has_struct_pattern_elements;
849
849
StructPatternElements elems;
850
850
851
- // TODO: should this store location data? Accessor uses path location data.
852
851
NodeId node_id;
852
+ Location locus;
853
853
854
854
public:
855
855
std::string as_string () const override ;
856
856
857
857
// Constructs a struct pattern from specified StructPatternElements
858
- StructPattern (PathInExpression struct_path,
858
+ StructPattern (PathInExpression struct_path, Location locus,
859
859
StructPatternElements elems
860
860
= StructPatternElements::create_empty ())
861
861
: path (std::move (struct_path)), elems (std::move (elems)),
862
- node_id (Analysis::Mappings::get ()->get_next_node_id ())
862
+ node_id (Analysis::Mappings::get ()->get_next_node_id ()), locus (locus)
863
863
{}
864
864
865
865
/* TODO: constructor to construct via elements included in
Original file line number Diff line number Diff line change @@ -10603,7 +10603,8 @@ Parser<ManagedTokenSource>::parse_pattern ()
10603
10603
}
10604
10604
10605
10605
return std::unique_ptr<AST::StructPattern> (
10606
- new AST::StructPattern (std::move (path), std::move (elems)));
10606
+ new AST::StructPattern (std::move (path), t->get_locus (),
10607
+ std::move (elems)));
10607
10608
}
10608
10609
default :
10609
10610
// assume path in expression
@@ -11057,7 +11058,8 @@ Parser<ManagedTokenSource>::parse_ident_leading_pattern ()
11057
11058
rust_debug (" successfully parsed struct pattern" );
11058
11059
11059
11060
return std::unique_ptr<AST::StructPattern> (
11060
- new AST::StructPattern (std::move (path), std::move (elems)));
11061
+ new AST::StructPattern (std::move (path), initial_tok->get_locus (),
11062
+ std::move (elems)));
11061
11063
}
11062
11064
case DOT_DOT_EQ:
11063
11065
case ELLIPSIS: {
You can’t perform that action at this time.
0 commit comments