aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/parse/rust-parse-impl.h
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2022-02-17 16:36:34 +0100
committerArthur Cohen <arthur.cohen@embecosm.com>2022-02-18 09:10:55 +0100
commit0e15b89839170cb6c9115cfc57310af2170423a0 (patch)
tree72b1cf54a3a6c8ed1584defaa2964e47b10428c9 /gcc/rust/parse/rust-parse-impl.h
parent425ebda24393eb4f40190228b7ef4b69e6253251 (diff)
downloadgcc-0e15b89839170cb6c9115cfc57310af2170423a0.zip
gcc-0e15b89839170cb6c9115cfc57310af2170423a0.tar.gz
gcc-0e15b89839170cb6c9115cfc57310af2170423a0.tar.bz2
struct pattern: Add location on struct name
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
-rw-r--r--gcc/rust/parse/rust-parse-impl.h6
1 files changed, 4 insertions, 2 deletions
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<ManagedTokenSource>::parse_pattern ()
}
return std::unique_ptr<AST::StructPattern> (
- 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<ManagedTokenSource>::parse_ident_leading_pattern ()
rust_debug ("successfully parsed struct pattern");
return std::unique_ptr<AST::StructPattern> (
- 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: {