From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 0E8C73858419; Mon, 26 Sep 2022 11:04:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0E8C73858419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664190256; bh=ovv0u4Tn4j1kikqSY8LzRegDJHIEUYLyrouAOghVM7c=; h=From:To:Subject:Date:From; b=GIuMwcS7TLyjdX7584NxREM7B/rgROAqGdbNGZyeQODS8DER+YcEKZ/98IiYkaLAz wiRNxAnP+zrxbWLUU9b6wuOE6FfAQUM0dudg/m1FGfNW/rZ61NHFa5Gx4ZC4Qoyh+S nHpFLkTC4GaknrCfupLs/E6V8TCa/j2q2Jb2Ykhw= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] attributes: Add #[macro_use] as builtin X-Act-Checkin: gcc X-Git-Author: Arthur Cohen X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: f252b4093666cf1e3d948b22f00fc12bf283a83f X-Git-Newrev: c71b174a29cbd85a4961686eacd02d1fe2a36ea3 Message-Id: <20220926110416.0E8C73858419@sourceware.org> Date: Mon, 26 Sep 2022 11:04:16 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c71b174a29cbd85a4961686eacd02d1fe2a36ea3 commit c71b174a29cbd85a4961686eacd02d1fe2a36ea3 Author: Arthur Cohen Date: Tue Sep 13 16:30:28 2022 +0200 attributes: Add #[macro_use] as builtin Diff: --- gcc/rust/util/rust-attributes.cc | 1 + gcc/testsuite/rust/compile/macro_export_1.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/gcc/rust/util/rust-attributes.cc b/gcc/rust/util/rust-attributes.cc index 766697a4600..509f70fe4db 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 00000000000..f87df083624 --- /dev/null +++ b/gcc/testsuite/rust/compile/macro_export_1.rs @@ -0,0 +1,2 @@ +#[macro_use] +mod foo {}