Message ID | 20240130121026.807464-78-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:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1193134dyb; Tue, 30 Jan 2024 04:47:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IF6t+M0XRlV7DhDOEm/KQg28rHfMXuhLUYiCpGzLHFcgnSkn1Zq3y1pj5sx+5x22mhXJgiY X-Received: by 2002:a05:6214:2266:b0:68c:46e0:78d with SMTP id gs6-20020a056214226600b0068c46e0078dmr6921467qvb.45.1706618830148; Tue, 30 Jan 2024 04:47:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706618830; cv=pass; d=google.com; s=arc-20160816; b=Xad/eydZK2LsNTX2GzKJPA43/kvk7OYCp01OrhJDnhcQ5Cb2J1mBMyc/P9x1C6Y0wK jUwttI/LADDPjV6qodPIFV0RWkXwRimDRQeXOncanu0SSW/6U8woxOR7bNpmjZcLpFy7 SR5UAFH+TgA0u5ARY/EUf7dVfm7AE4/sGIvHzw80nNPxtFlQHMKedAYvadHrZiQbihHH SXWROMIkQ/bsVZX7PQ/DRy7effCZGr9CyIqNUhtVgWnwXfuyfoCl7fI0uDZMC/8jfav5 goSXuUrTb8byLv4d8Rsp2RnQQrxh/wwM15z5E/7Hta6+uNa1dvZ/WrYuK1ZZr51/RRzn mZ9g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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:arc-filter:dmarc-filter:delivered-to; bh=1BUHStVa7bCrP5affO7AgJPGu/x7+mpr7WEi5uG/BCo=; fh=tF/FjG7igJhcOEGq79wqr3ldeoZUVk5V7TNEGxaLUD4=; b=J/XvAEBbolRinbd11oinns2A4Op6X1i8874n596xrq9QmUX9YRfxMjz6p330NFATsX uoPmJMPZS4SsYKrKM0dGHw0Ea1jYcKmvbt3PdIr/txFCJL8hDIzd4vNKJXgpfsnBuTtE ahZArA9r1FXGlBytDPTdo0NuR/fwSui5BMnGLvgusIqyiSYOp/ZARmT8wq2dQhbC+W/1 YjH2307MytABCcSW7PJk+HakfeJiz/6Rn8iS/Nu2JGtMpIlyQjQbvUSS381nvsLz/Rk3 e/SnRATN/J09UsCMtuXH4QSFiy8b/ryGP/N2K9exwB45nn2b30czmMYUg4eBx60eomO3 6jDQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=NYpjlj7A; arc=pass (i=1); 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id v22-20020a05620a091600b0078408a9922bsi1973162qkv.168.2024.01.30.04.47.10 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:47:10 -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=NYpjlj7A; arc=pass (i=1); 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 47D3C3860757 for <ouuuleilei@gmail.com>; Tue, 30 Jan 2024 12:47:01 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id C2E8F385770F for <gcc-patches@gcc.gnu.org>; Tue, 30 Jan 2024 12:11:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C2E8F385770F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C2E8F385770F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::430 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616745; cv=none; b=QYJODck+SKTshqUEywr6hVbpEo2xTqdad3MnjXyFqXNzUAv6Q1kfc0oGzED7/pbjVeO4ySEfMhv+iD+psWdlcaXqrqjKgz/K3QnDmZjxXqGaerKPVrvcpqnN7iHTYhla+UjLv7gy6vyqNJ3P3tvNQvh7pd3Ns6KPE/AYMhu4uIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616745; c=relaxed/simple; bh=SmYWCNOh62qQLiYJos6SzaJp5FTuQvoVPlirWor1HJ0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Ev27vw7FQIlKI6HjysjmSOPzVNvkOVgUHcZ0j4LA+/9uDt6ofHlnPaUH4ycybHERHFhCypsgRA+MplIZmSTh7QGGbM2EN04yY+qcCuDv04bNVTXGWVuAcVEk627lL9aTtpH5xSdn8fb0v5/qZINon2iUv1MMGztRKGvBIniHCVE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3394b892691so2129926f8f.1 for <gcc-patches@gcc.gnu.org>; Tue, 30 Jan 2024 04:11:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616705; x=1707221505; darn=gcc.gnu.org; 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=1BUHStVa7bCrP5affO7AgJPGu/x7+mpr7WEi5uG/BCo=; b=NYpjlj7AOfRoM7csvD6331QJ1cNiQFWWjCmm5KCYzO+gWqHLoUYcp3H8ODTtAXajc7 sXdGGNi3Fd+DU0RN1sGUwv52c2rPAYH7lrtNtarJ+R0JPQ6Ty2ozHLI7W9YNUDn3OgJd 0vGtVi1qFztDOiqjI/KEjMjIlRB1AyH1YEbD4KCYP/HDxr3esDeV+bY0oIBsAwj6cuRg ca0em+D94VAZBiQPoY8wsGp+mVeSS1xNUIlSB5eA/GO5UgwfmqyQv+G5ZlfLzbxAbz6G Lqh9n6zLw19O6ZlRXSYP+pkWHZWgt/KK1HMA7YlEqyUBPdfAyl00WLyWN2+METa9bu8l InVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616705; x=1707221505; 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=1BUHStVa7bCrP5affO7AgJPGu/x7+mpr7WEi5uG/BCo=; b=nKtZR5VGKElKkRT3xeCev8jU/G6FhxmBzvAmsWsrHvnZJPmhLcaXyuilw8A2dZ5cl7 L4WjqmNUMlh94TawYrEWkjEJ+dN8V/LsK+DanChpzbDqi1qr5SeBj8gqI/syTH9+5uvC pZdwOK92HT0N3r3tEwWkgmuV3FApOLMuAnfwAoQhPmf5h0KNTn/L0G3Uxm+cLvYRAlf2 5xM13qrCysVfgiq116NpFVIrW/Ir9v/PapcS227nDp1ZUeCslsIRfEXTe/v+JmyTJ+d9 TzQdoqRNfWffmQD9eGbg5bajIya2bikjLxKGQj1gtXyku3/c074D8HiiXhx1Y47BTvY5 oXuw== X-Gm-Message-State: AOJu0YwAEdWqoSEq8Gy7eQvT1CYkk87WXDJzOtDk6BBCOaz9OxEbVJCM W7A8TwCh3c3ctjPsKxjBd6RuVqpsNa2rqEmQWapVCpt+vzm+z6fb/2PCO4KDRYlSo4HsBHFxv5N gJQ== X-Received: by 2002:a5d:640d:0:b0:33a:ded0:c309 with SMTP id z13-20020a5d640d000000b0033aded0c309mr1324318wru.13.1706616705290; Tue, 30 Jan 2024 04:11:45 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id f9-20020a056000036900b00339307d9d31sm10569894wrf.112.2024.01.30.04.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:11:44 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Jakub Dupak <dev@jakubdupak.com> Subject: [COMMITTED 075/101] gccrs: TyTy: refactor to new API Date: Tue, 30 Jan 2024 13:07:31 +0100 Message-ID: <20240130121026.807464-78-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.42.1 In-Reply-To: <20240130121026.807464-2-arthur.cohen@embecosm.com> References: <20240130121026.807464-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.2 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, T_SCC_BODY_TEXT_LINE autolearn=ham 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.30 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789519546148860590 X-GMAIL-MSGID: 1789519546148860590 |
Series |
[COMMITTED,001/101] gccrs: Add visibility to trait item
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | warning | Git am fail log |
Commit Message
Arthur Cohen
Jan. 30, 2024, 12:07 p.m. UTC
From: Jakub Dupak <dev@jakubdupak.com> gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-type.cc (TypeCheckType::resolve_root_path): Refactor. Signed-off-by: Jakub Dupak <dev@jakubdupak.com> --- gcc/rust/typecheck/rust-hir-type-check-type.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/gcc/rust/typecheck/rust-hir-type-check-type.cc b/gcc/rust/typecheck/rust-hir-type-check-type.cc index 62a17769c3f..951920138cb 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-type.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-type.cc @@ -442,14 +442,9 @@ TypeCheckType::resolve_root_path (HIR::TypePath &path, size_t *offset, root_tyty = lookup; // this enforces the proper get_segments checks to take place - bool is_adt = root_tyty->get_kind () == TyTy::TypeKind::ADT; - if (is_adt) - { - const TyTy::ADTType &adt - = *static_cast<const TyTy::ADTType *> (root_tyty); - if (adt.is_enum ()) - return root_tyty; - } + auto *maybe_adt = root_tyty->try_as<const TyTy::ADTType> (); + if (maybe_adt && maybe_adt->is_enum ()) + return root_tyty; } return root_tyty;