diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-09-26 06:58:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 06:58:57 +0000 |
commit | cfd2938f069598e9be25484f16ac045606c69e72 (patch) | |
tree | 201ecfb8422d475e43b157070b10b25afae86fce /gcc | |
parent | 6da3cab7b0acf5dc363c85069bef716923ddf90c (diff) | |
parent | c71b174a29cbd85a4961686eacd02d1fe2a36ea3 (diff) | |
download | gcc-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.cc | 1 | ||||
-rw-r--r-- | gcc/testsuite/rust/compile/macro_export_1.rs | 2 |
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 {} |