[PATCH] Rust: Remove ENUM_BITFIELD in Rust. [PR125507]

Arthur Cohen arthur.cohen@opensrcsec.com
Fri Sep 4 12:27:39 GMT 2026


Hi Kael,

The Rust patch looks good to me.

Thanks!

Arthur

On 9/4/26 2:16 PM, Kael Andrew Alonzo Franco wrote:
> GCC requires C++14 and C++ supports enum bitfield so ENUM_BITFIELD is deprecated macro.
> 
> Bootstrapped and regtested on x86_64-pc-linux-gnu.
> 
> 	PR middle-end/125507
> 
> gcc/rust/ChangeLog:
> 
> 	* backend/rust-tree.h (struct lang_decl_base): Remove ENUM_BITFIELD.
> 	(struct rust_cp_binding_level): Ditto.
> 
> Signed-off-by: Kael Andrew Franco <kaelfandrew@gmail.com>
> ---
>   gcc/rust/backend/rust-tree.h | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/rust/backend/rust-tree.h b/gcc/rust/backend/rust-tree.h
> index b995d0afd8a..21edfe389f4 100644
> --- a/gcc/rust/backend/rust-tree.h
> +++ b/gcc/rust/backend/rust-tree.h
> @@ -1971,7 +1971,7 @@ enum lang_decl_selector
>   
>   struct GTY (()) lang_decl_base
>   {
> -  ENUM_BITFIELD (lang_decl_selector) selector : 3;
> +  enum lang_decl_selector selector : 3;
>     unsigned use_template : 2;
>     unsigned not_really_extern : 1;    /* var or fn */
>     unsigned initialized_in_class : 1; /* var or fn */
> @@ -2189,7 +2189,7 @@ struct GTY (()) rust_cp_binding_level
>     /* The kind of scope that this object represents.  However, a
>         SK_TEMPLATE_SPEC scope is represented with KIND set to
>         SK_TEMPLATE_PARMS and EXPLICIT_SPEC_P set to true.  */
> -  ENUM_BITFIELD (scope_kind) kind : 4;
> +  enum scope_kind kind : 4;
>   
>     /* True if this scope is an SK_TEMPLATE_SPEC scope.  This field is
>         only valid if KIND == SK_TEMPLATE_PARMS.  */



More information about the Gcc-rust mailing list