aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2023-03-28 11:34:27 +0200
committerPhilip Herron <philip.herron@embecosm.com>2023-03-29 21:14:15 +0000
commit9af9a69367f7f714d303aa35f8d39d27c3c9df54 (patch)
tree4082739c57f910cd05a978115345ad6a0afd470d
parent649af3ed287dd37d65869ef28d36e7b6ef7741f7 (diff)
downloadgcc-9af9a69367f7f714d303aa35f8d39d27c3c9df54.zip
gcc-9af9a69367f7f714d303aa35f8d39d27c3c9df54.tar.gz
gcc-9af9a69367f7f714d303aa35f8d39d27c3c9df54.tar.bz2
ast: Fix location for pub(crate)
When creating a SimplePath from a string, we end up creating a path which contains only one segment but no location. Take the location of the one segment instead and use it as the simple path's location. gcc/rust/ChangeLog: * ast/rust-ast.h: Call SimplePath constructor differently in SimplePath::from_str
-rw-r--r--gcc/rust/ast/rust-ast.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h
index 2c39cc7c..90a5773 100644
--- a/gcc/rust/ast/rust-ast.h
+++ b/gcc/rust/ast/rust-ast.h
@@ -413,7 +413,7 @@ public:
{
std::vector<AST::SimplePathSegment> single_segments
= {AST::SimplePathSegment (std::move (str), locus)};
- return SimplePath (std::move (single_segments));
+ return SimplePath (std::move (single_segments), false, locus);
}
const std::vector<SimplePathSegment> &get_segments () const