diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-07-31 15:10:41 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:04:32 +0100 |
commit | 22bce7cbfa02a53f5505971211374cf336e07aa1 (patch) | |
tree | bafb0563863676195e20defac1a307505bb049dc | |
parent | 872ea1ab969425c0db804d78d8c3fa2a8144accd (diff) | |
download | gcc-22bce7cbfa02a53f5505971211374cf336e07aa1.zip gcc-22bce7cbfa02a53f5505971211374cf336e07aa1.tar.gz gcc-22bce7cbfa02a53f5505971211374cf336e07aa1.tar.bz2 |
gccrs: 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.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc index 1349946..cb0281e 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 ()) |