aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/ast/rust-ast-full-test.cc5
-rw-r--r--gcc/rust/ast/rust-macro.h5
2 files changed, 6 insertions, 4 deletions
diff --git a/gcc/rust/ast/rust-ast-full-test.cc b/gcc/rust/ast/rust-ast-full-test.cc
index 5c8e04f..f15a191 100644
--- a/gcc/rust/ast/rust-ast-full-test.cc
+++ b/gcc/rust/ast/rust-ast-full-test.cc
@@ -4125,7 +4125,7 @@ AttributeParser::parse_meta_item_inner ()
skip_token ();
// FIXME: We probably need a Location here as well
return std::unique_ptr<MetaWord> (
- new MetaWord (identifier->as_string ()));
+ new MetaWord (identifier->as_string (), identifier->get_locus ()));
}
if (peek_token (1)->get_id () == EQUAL)
@@ -4731,8 +4731,7 @@ MetaItemSeq::to_attribute () const
Attribute
MetaWord::to_attribute () const
{
- // FIXME: How do we get a location here?
- return Attribute (SimplePath::from_str (ident, Location ()), nullptr);
+ return Attribute (SimplePath::from_str (ident, ident_locus), nullptr);
}
Attribute
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index 4b0a412..5270d11 100644
--- a/gcc/rust/ast/rust-macro.h
+++ b/gcc/rust/ast/rust-macro.h
@@ -759,9 +759,12 @@ protected:
class MetaWord : public MetaItem
{
Identifier ident;
+ Location ident_locus;
public:
- MetaWord (Identifier ident) : ident (std::move (ident)) {}
+ MetaWord (Identifier ident, Location ident_locus)
+ : ident (std::move (ident)), ident_locus (ident_locus)
+ {}
std::string as_string () const override { return ident; }