From 0e15b89839170cb6c9115cfc57310af2170423a0 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Thu, 17 Feb 2022 16:36:34 +0100 Subject: struct pattern: Add location on struct name --- gcc/rust/parse/rust-parse-impl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gcc/rust/parse/rust-parse-impl.h') diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index c35595c..2260a95 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -10603,7 +10603,8 @@ Parser::parse_pattern () } return std::unique_ptr ( - new AST::StructPattern (std::move (path), std::move (elems))); + new AST::StructPattern (std::move (path), t->get_locus (), + std::move (elems))); } default: // assume path in expression @@ -11057,7 +11058,8 @@ Parser::parse_ident_leading_pattern () rust_debug ("successfully parsed struct pattern"); return std::unique_ptr ( - new AST::StructPattern (std::move (path), std::move (elems))); + new AST::StructPattern (std::move (path), initial_tok->get_locus (), + std::move (elems))); } case DOT_DOT_EQ: case ELLIPSIS: { -- cgit v1.1