]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: ast: Fix location for pub(crate)
authorArthur Cohen <arthur.cohen@embecosm.com>
Tue, 28 Mar 2023 09:34:27 +0000 (11:34 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:28:39 +0000 (18:28 +0100)
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

gcc/rust/ast/rust-ast.h

index 5e5913b95f60b02957213d13dfdab7624a699019..70da859134081b8366072c5372f3ffb34387a9ac 100644 (file)
@@ -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