aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-09-26 06:58:57 +0000
committerGitHub <noreply@github.com>2022-09-26 06:58:57 +0000
commitcfd2938f069598e9be25484f16ac045606c69e72 (patch)
tree201ecfb8422d475e43b157070b10b25afae86fce /gcc
parent6da3cab7b0acf5dc363c85069bef716923ddf90c (diff)
parentc71b174a29cbd85a4961686eacd02d1fe2a36ea3 (diff)
downloadgcc-cfd2938f069598e9be25484f16ac045606c69e72.zip
gcc-cfd2938f069598e9be25484f16ac045606c69e72.tar.gz
gcc-cfd2938f069598e9be25484f16ac045606c69e72.tar.bz2
Merge #1532
1532: attributes: Add #[macro_use] as builtin r=CohenArthur a=CohenArthur Fixes #1531 I think the checking for builtin attributes should definitely be moved to the `AttributeChecker` visitor. It's also a bit messy at the moment considering it isn't in effect on *everything*, simply some nodes such as `Module`s. Thoughts? Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/util/rust-attributes.cc1
-rw-r--r--gcc/testsuite/rust/compile/macro_export_1.rs2
2 files changed, 3 insertions, 0 deletions
diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc
index 766697a..509f70f 100644
--- a/gcc/rust/util/rust-attributes.cc
+++ b/gcc/rust/util/rust-attributes.cc
@@ -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
index 0000000..f87df08
--- /dev/null
+++ b/gcc/testsuite/rust/compile/macro_export_1.rs
@@ -0,0 +1,2 @@
+#[macro_use]
+mod foo {}