]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Ease some constraints on derive definition
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Mon, 31 Jul 2023 11:08:06 +0000 (13:08 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 18:04:32 +0000 (19:04 +0100)
Member function is_derive was overly constrained, the attribute changes
when we parse it's meta items and it no longer contains a tokenstream
while staying a derive.

gcc/rust/ChangeLog:

* ast/rust-ast.cc (Attribute::is_derive): Remove tokenstream
condition.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/ast/rust-ast.cc

index 3525a15beb5856bb0b0d5ac9ce24bf6bd50c306d..13499461b1c90ec142bb693b8c190b843941861e 100644 (file)
@@ -84,10 +84,7 @@ Attribute::as_string () const
 bool
 Attribute::is_derive () const
 {
-  return has_attr_input ()
-        && get_attr_input ().get_attr_input_type ()
-             == AST::AttrInput::TOKEN_TREE
-        && get_path () == "derive";
+  return has_attr_input () && get_path () == "derive";
 }
 
 /**