Message ID | 20230221120230.596966-70-arthur.cohen@embecosm.com |
---|---|
State | Unresolved |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1845187wrn; Tue, 21 Feb 2023 04:56:26 -0800 (PST) X-Google-Smtp-Source: AK7set+NdGKhZDTxbp6Z1+hB8gh3LJASFDp8nukkFZgbi9poIh5q1J13PHCFJcKkqyRbaQsZQXjq X-Received: by 2002:a17:907:a42a:b0:8b1:730b:a296 with SMTP id sg42-20020a170907a42a00b008b1730ba296mr21568103ejc.15.1676984186151; Tue, 21 Feb 2023 04:56:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676984186; cv=none; d=google.com; s=arc-20160816; b=qSmU8H/IV0JOwDpSfcBxrdygsDVJaruS6J7ovF79cKYbWuLkKaKrv8QY8aURfKuWpM OOmf/2bIUogLoEhoykU+osQ+fSeKtlQhw09koHAED7mkHJct2hnoFU2YKqL8SzL2M8wo skaaDsZX912Jq+FwgsKMW2c0sXdCC0GEYzzHOVGp+hwD8cxiH7JCVPSMBU7hVWpiX9iO /pZF9Ci+yRRBtTIoD3ENVc2kqXXc9A2aQl2ULhD+ntH+LPlqtfHMmuLEt8ssKQPM/SRu OG0D+XWDiGvVcKMk+9R3UyXm3zQ14IHOng8x+sY8gE5YbFybi6loL7bqd+5y8jsG2Enr lqUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dmarc-filter :delivered-to; bh=2FSqGpQictYqql6UW0VVozec41h7KkoljpT/l0GbZFI=; b=zadlIaahJt3MC8FT7KVXQboOMbPEH31UYbGS476L52LxJ/Uhx5q+FaYAU5EL8R52Uq o5ugim7RKNzP00FcPcWnycKHzpJGLAvvllAoVJIonOHlc6r5FznhmebH6nbQ0H31b+bE FVZyUp15yi3p/sc2Cl8STRsxPXtmow8jXlMTV/I5jHsnkrnpnUSdPEfWofEXv5irta90 T50ZrN2lSqUsZGlIO1ja7ndA1s6hD0TO7c8BpJ8i2nKhRwTFK9r7gNhJlbx8nhz7IW1C hNF2t+qAigdnA56MEXeoGPYt4XrwHbEVuJR2WB2YPHb/LjQKKTo5+hlLgkbb60LGu4PT Iw4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=IstCGMkA; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id q9-20020a056402032900b0049f1f3402f4si6417439edw.87.2023.02.21.04.56.26 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:56:26 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=IstCGMkA; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 46ACB39730E0 for <ouuuleilei@gmail.com>; Tue, 21 Feb 2023 12:19:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 55C1B3881D2B for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 12:04:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 55C1B3881D2B 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-wr1-x42e.google.com with SMTP id 6so3758922wrb.11 for <gcc-patches@gcc.gnu.org>; Tue, 21 Feb 2023 04:04:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=2FSqGpQictYqql6UW0VVozec41h7KkoljpT/l0GbZFI=; b=IstCGMkA2c3JDaFgCrRjc3gvTHi08Fl/+WaRHxg45jXZmoOFyIVCWn8yMpuXshKse+ cyZHO+DT6rrsetT4RDhtm1f204emuEY7o2Ex1ozqoPdd6Sn5axyikjHVKAdF0icfO46P SXA7vFSSla2OVGPkP+nkya2+2T6T2FQIB5g3VhAW/YzoCGWHMx9RWVXWMa+mSfcOhVUN cmBACKGBKA5mZLFKE49inJ+hmWKAA7uCAA6IJ7CVWu3Uv+AuUPwjFp8b7a8eUGyl1iZg TJyuR9FYOzNWvBJwLp1UezPU9X1LX6viEMxVOtVo5xA5vGmuXsu8i8pP//xbfOD+ft/w Yz3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2FSqGpQictYqql6UW0VVozec41h7KkoljpT/l0GbZFI=; b=3USivIwNSn8F+de6uyYsntokXZC32sVWEGmYGYjbrihS7w0+/QdYe5SeO4p2RiRf2j dlc9XUEj2dn0ZGQyxQDomKkOEenvBlNFlw1/j366ip/UWjK4CIwBTi1HBfXUYNq3Qgyl EQ79rD+Ct+djN+d7XVIsI0yMzyIl0PSaFtgWguHQELTLQdnoANaMoMjfuIy9nAWyGiFj xznpVL0AbTwcE5j2eU1qTV1ebDuLw0H8Qhh1La/hxOD2MNjjzPjUZz9V9aJJctLmHB89 AHKRYITvtuHaNPoS3X0gPfMskW3UOXW19FAaHvQsjxgNCMYdyouOEWXLBN4CauLCPeqt 0JpA== X-Gm-Message-State: AO0yUKUMFmETwVLSrk3ANIeUPAHswUMU2icz6H75p7ilsoyadLHyj5Hp j2ARHYh4jFIqCp6PpcWnfCw6iLWPDwo5PX4zBw== X-Received: by 2002:a5d:53c5:0:b0:2c5:581d:5a1d with SMTP id a5-20020a5d53c5000000b002c5581d5a1dmr4069238wrw.43.1676981060528; Tue, 21 Feb 2023 04:04:20 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id c15-20020adffb4f000000b002c55b0e6ef1sm5013811wrs.4.2023.02.21.04.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:04:19 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Raiki Tamura <tamaron1203@gmail.com> Subject: [committed 069/103] gccrs: add lang item "phantom_data" Date: Tue, 21 Feb 2023 13:01:59 +0100 Message-Id: <20230221120230.596966-70-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221120230.596966-1-arthur.cohen@embecosm.com> References: <20230221120230.596966-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.8 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758445369705620841?= X-GMAIL-MSGID: =?utf-8?q?1758445369705620841?= |
Series |
[committed,001/103] gccrs: Fix missing dead code analysis ICE on local enum definition
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Arthur Cohen
Feb. 21, 2023, 12:01 p.m. UTC
From: Raiki Tamura <tamaron1203@gmail.com>
gcc/rust/ChangeLog:
* util/rust-lang-item.h: Add handling for `phantom_data` lang item.
gcc/testsuite/ChangeLog:
* rust/compile/torture/phantom_data.rs: New test.
---
gcc/rust/util/rust-lang-item.h | 9 +++++++++
gcc/testsuite/rust/compile/torture/phantom_data.rs | 11 +++++++++++
2 files changed, 20 insertions(+)
create mode 100644 gcc/testsuite/rust/compile/torture/phantom_data.rs
diff --git a/gcc/rust/util/rust-lang-item.h b/gcc/rust/util/rust-lang-item.h index 02eeaee60df..ea0c91aa5f2 100644 --- a/gcc/rust/util/rust-lang-item.h +++ b/gcc/rust/util/rust-lang-item.h @@ -73,6 +73,9 @@ public: MUT_PTR, CONST_SLICE_PTR, + // https://github.com/rust-lang/rust/blob/master/library/core/src/marker.rs + PHANTOM_DATA, + // functions FN_ONCE, FN_ONCE_OUTPUT, @@ -222,6 +225,10 @@ public: { return ItemType::CONST_SLICE_PTR; } + else if (item.compare ("phantom_data") == 0) + { + return ItemType::PHANTOM_DATA; + } else if (item.compare ("fn_once") == 0) { return ItemType::FN_ONCE; @@ -308,6 +315,8 @@ public: return "mut_ptr"; case CONST_SLICE_PTR: return "const_slice_ptr"; + case PHANTOM_DATA: + return "phantom_data"; case FN_ONCE: return "fn_once"; case FN_ONCE_OUTPUT: diff --git a/gcc/testsuite/rust/compile/torture/phantom_data.rs b/gcc/testsuite/rust/compile/torture/phantom_data.rs new file mode 100644 index 00000000000..89e76aeb5eb --- /dev/null +++ b/gcc/testsuite/rust/compile/torture/phantom_data.rs @@ -0,0 +1,11 @@ +// { dg-options "-w" } +#[lang = "phantom_data"] +struct PhantomData<T>; + +trait Hash { + fn hash<H>(&self, state: &mut H); +} + +impl<T> Hash for PhantomData<T> { + fn hash<H>(&self, state: &mut H) {} +}