From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id 58C5D3949099 for ; Tue, 31 Jan 2023 13:22:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 58C5D3949099 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x32d.google.com with SMTP id q10-20020a1cf30a000000b003db0edfdb74so770967wmq.1 for ; Tue, 31 Jan 2023 05:22:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=AQR5ypjWhx/IiWO1kzEbf096jX5VSnlQCMZmq1P+Pto=; b=ghsBi/6jdAnqXRypzc5PT7cteTEvfwc16zb6kutyRcdWuVqA6LInzZ/SBaVrwqrZKu NzKNtQsAlbjsqw8iIzHZJ9DvF+6Y6Ma8OfbFRRfvO9pQDbMJILZn8scdpyhrVYDAY8ZU 7KN07E8nvwUTa48uXuJDwMlqbrxVlcKQlLgF02/2HqvtqT36gt6AlBx2t2ZtN6+AqJCl uGETXXUTpyUHrBCBrCf3x610HKTsEeZEwLtzzhGXejyVqk99HfjjB/mVAx+egN01mQGg +rLHgxuiOFkxMOHWsh00FeSNCBNOaGCvQAxONbQWODehLF7NxSKjsptYBEBoXzeuSDo9 u9cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AQR5ypjWhx/IiWO1kzEbf096jX5VSnlQCMZmq1P+Pto=; b=QjTAbvnupswx5knwNCkEUOe1otGbVhGjSieLXLejLJ3wVyE7S7sxrfZf1VZCK/y/jN q5fKQ8P+ybEnXlZjhnLRMxFR1jTwY044xDHB82cXCUfvYGJM2SbRq9M5DUI69q/CvwY9 zYbAJwbjfKNRadjBYRUt+Ya8ipJwXDzdyq3xhbv0L0uHTP33aLuP4kNHgOTmoau1ygZN Vf1Oc0WU09ZJ9ccMeUfUEg/mb/XZj+fjSFmzECuhf3DqZ/No6QakzRHIjq5SAe3m3wwG dUDD45+Yy3AvcT/I+PPVvVDxw+ZLDQAOO8NCLT+1PxhlMpaomRjsJzVDhaRPCuLvhkim aODg== X-Gm-Message-State: AO0yUKUW3SDM4QAHCYsuQDXeVCvNNuYw0uO8Au+D3xjXQZyUORkjAWse ls4eW+PJ4nFCzJeEeP1/t723 X-Google-Smtp-Source: AK7set8E2PCZOP1rIU4ZvuXhNznomNuZNP0RTjwi4C/mHQKNzZ9fUBoSoPueacW+vC+Nj/D5wUp4Ig== X-Received: by 2002:a05:600c:4691:b0:3dc:24fc:ef6f with SMTP id p17-20020a05600c469100b003dc24fcef6fmr20719260wmo.40.1675171351221; Tue, 31 Jan 2023 05:22:31 -0800 (PST) Received: from platypus.lan ([2001:861:5e4c:3bb0:6424:328a:1734:3249]) by smtp.gmail.com with ESMTPSA id q17-20020a05600c2e5100b003dd1c45a7b0sm2350740wmf.23.2023.01.31.05.22.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Jan 2023 05:22:30 -0800 (PST) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen Subject: [COMMITTED] gccrs: attributes: Add #[macro_use] as builtin Date: Tue, 31 Jan 2023 14:26:16 +0100 Message-Id: <20230131132616.663136-1-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-15.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. Tested on x86_64-pc-linux-gnu, committed on master. --- gcc/rust/util/rust-attributes.cc | 1 + gcc/testsuite/rust/compile/macro_export_1.rs | 2 ++ 2 files changed, 3 insertions(+) create mode 100644 gcc/testsuite/rust/compile/macro_export_1.rs 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 {} -- 2.39.1