]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: attributes: Add #[macro_use] as builtin
authorArthur Cohen <arthur.cohen@embecosm.com>
Tue, 13 Sep 2022 14:30:28 +0000 (16:30 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 31 Jan 2023 13:16:51 +0000 (14:16 +0100)
gcc/rust/ChangeLog:

* util/rust-attributes.cc: Add `macro_use` to list of builtin
attributes.

gcc/testsuite/ChangeLog:

* rust/compile/macro_export_1.rs: New test.

gcc/rust/util/rust-attributes.cc
gcc/testsuite/rust/compile/macro_export_1.rs [new file with mode: 0644]

index 9db77b40dfb54576478e68e15dfc3fb3ab7ab615..1c85273e54130cd538248fdeea6cd42ead52ad23 100644 (file)
@@ -40,6 +40,7 @@ static const BuiltinAttrDefinition __definitions[]
      {"no_mangle", CODE_GENERATION},
      {"repr", CODE_GENERATION},
      {"path", EXPANSION},
+     {"macro_use", NAME_RESOLUTION},
      // From now on, these are reserved by the compiler and gated through
      // #![feature(rustc_attrs)]
      {"rustc_inherit_overflow_checks", CODE_GENERATION}};
diff --git a/gcc/testsuite/rust/compile/macro_export_1.rs b/gcc/testsuite/rust/compile/macro_export_1.rs
new file mode 100644 (file)
index 0000000..f87df08
--- /dev/null
@@ -0,0 +1,2 @@
+#[macro_use]
+mod foo {}