From: Arthur Cohen Date: Tue, 28 Mar 2023 09:34:27 +0000 (+0200) Subject: gccrs: ast: Fix location for pub(crate) X-Git-Tag: basepoints/gcc-15~2736 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e61de6657d315835a427da542f692a1db1d812a1;p=thirdparty%2Fgcc.git gccrs: 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 --- diff --git a/gcc/rust/ast/rust-ast.h b/gcc/rust/ast/rust-ast.h index 5e5913b95f60..70da85913408 100644 --- a/gcc/rust/ast/rust-ast.h +++ b/gcc/rust/ast/rust-ast.h @@ -413,7 +413,7 @@ public: { std::vector 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 &get_segments () const