[gcc r14-7978] gccrs: Ease some constraints on derive definition

Arthur Cohen cohenarthur@gcc.gnu.org
Tue Jan 16 18:10:29 GMT 2024


https://gcc.gnu.org/g:872ea1ab969425c0db804d78d8c3fa2a8144accd

commit r14-7978-g872ea1ab969425c0db804d78d8c3fa2a8144accd
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date:   Mon Jul 31 13:08:06 2023 +0200

    gccrs: Ease some constraints on derive definition
    
    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>

Diff:
---
 gcc/rust/ast/rust-ast.cc | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gcc/rust/ast/rust-ast.cc b/gcc/rust/ast/rust-ast.cc
index 3525a15beb5..13499461b1c 100644
--- a/gcc/rust/ast/rust-ast.cc
+++ b/gcc/rust/ast/rust-ast.cc
@@ -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";
 }
 
 /**


More information about the Gcc-cvs mailing list