aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-07-31 15:10:41 +0200
committerP-E-P <32375388+P-E-P@users.noreply.github.com>2023-09-05 14:05:36 +0000
commit439508893b50efaa518e1c81524a41a738df26cc (patch)
treef968f70a6b956a0ba38b857779f343353dd5b840
parent655da655c1b02c76c7167fe461adbb4e4a3ba1b2 (diff)
downloadgcc-439508893b50efaa518e1c81524a41a738df26cc.zip
gcc-439508893b50efaa518e1c81524a41a738df26cc.tar.gz
gcc-439508893b50efaa518e1c81524a41a738df26cc.tar.bz2
Parse unparsed derive tokenstreams
Derive attributes should be parsed before attempting to retrieve any traits. This will convert the tokenstream to a list of path if this hasn't been done previously. gcc/rust/ChangeLog: * ast/rust-ast.cc (Attribute::get_traits_to_derive): Convert tokenstream to path list. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
-rw-r--r--gcc/rust/ast/rust-ast.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc
index 5bb2134..126d0d6 100644
--- a/gcc/rust/ast/rust-ast.cc
+++ b/gcc/rust/ast/rust-ast.cc
@@ -95,6 +95,9 @@ Attribute::is_derive () const
std::vector<std::reference_wrapper<AST::SimplePath>>
Attribute::get_traits_to_derive ()
{
+ rust_assert (this->is_derive ());
+
+ this->parse_attr_to_meta_item ();
std::vector<std::reference_wrapper<AST::SimplePath>> result;
auto &input = get_attr_input ();
switch (input.get_attr_input_type ())