From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7905) id 69B2C3857B98; Tue, 31 Jan 2023 13:16:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69B2C3857B98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1675170994; bh=g1Tx6mvHGkeTmaAK5Hoxi5nuy1ZhHuL8NQNjmGgGnFw=; h=From:To:Subject:Date:From; b=RGz6coVWwTGvbsgV6cKSfuAUuPYD+m3mQ18uQjJZrAg05i8wCH1jN56/V4vSzJsWe BbgA4f3J1tj8SU56Wf+YyzQOdbrELGRdnPFQ17mbr+P5GJLZd55wq5mUGf1P9Yh+7W 2SUAeloxvef5r2vQfT/BJ48Mbsd8YkEtfkccVF/k= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Arthur Cohen To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5561] gccrs: attributes: Add #[macro_use] as builtin X-Act-Checkin: gcc X-Git-Author: Arthur Cohen X-Git-Refname: refs/heads/master X-Git-Oldrev: ff9d7741d4b9d5255bc809a7505225216ecc7b86 X-Git-Newrev: 739d0509ed55aa650f197618a0902c6e0553b639 Message-Id: <20230131131634.69B2C3857B98@sourceware.org> Date: Tue, 31 Jan 2023 13:16:34 +0000 (GMT) List-Id: https://gcc.gnu.org/g:739d0509ed55aa650f197618a0902c6e0553b639 commit r13-5561-g739d0509ed55aa650f197618a0902c6e0553b639 Author: Arthur Cohen Date: Tue Sep 13 16:30:28 2022 +0200 gccrs: attributes: Add #[macro_use] as builtin 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. 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 9db77b40dfb..1c85273e541 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 {}