]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: derive: Add dummy builtin transcriber for builtin derive macros.
authorArthur Cohen <arthur.cohen@embecosm.com>
Thu, 1 Jun 2023 14:23:27 +0000 (16:23 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:46:24 +0000 (18:46 +0100)
commit446c19201459ed73bc100b4844e8ecccee5bfe2e
tree0d3c578bfe34f234809261a61b6591072b85884c
parentc566f9081067c9328a0f07bcc8bac46dc69d1599
gccrs: derive: Add dummy builtin transcriber for builtin derive macros.

Fixes #2257.

Derive builtins do not need a real transcriber, but still need one. It
will however never be called since builtin derive macros get expanded
differently, and benefit from knowing on what kind of items they are
applied (struct, enums, unions) rather than receiving a list of tokens
like regular builtin macros.

gcc/rust/ChangeLog:

* expand/rust-macro-builtins.cc (MacroBuiltin::dummy): New function.
* expand/rust-macro-builtins.h: Declare it.

gcc/testsuite/ChangeLog:

* rust/compile/derive_macro7.rs: New test.
gcc/rust/expand/rust-macro-builtins.cc
gcc/rust/expand/rust-macro-builtins.h
gcc/testsuite/rust/compile/derive_macro7.rs [new file with mode: 0644]