From 9af9a69367f7f714d303aa35f8d39d27c3c9df54 Mon Sep 17 00:00:00 2001 From: Arthur Cohen Date: Tue, 28 Mar 2023 11:34:27 +0200 Subject: 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 --- gcc/rust/ast/rust-ast.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc') 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 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 -- cgit v1.1