From patchwork Thu Aug 1 14:57:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 1967804 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=embecosm.com header.i=@embecosm.com header.a=rsa-sha256 header.s=google header.b=U2lR+bO1; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WZXsC5JDQz1ybV for ; Fri, 2 Aug 2024 01:27:43 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA4BC385DDEE for ; Thu, 1 Aug 2024 15:27:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by sourceware.org (Postfix) with ESMTPS id 2A3AC3860C2C for ; Thu, 1 Aug 2024 14:59:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2A3AC3860C2C 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 2A3AC3860C2C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::52e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722524444; cv=none; b=I+vLlsayJHxOpmYGAOEAf3SdRcz+38ZIriwJf4o9PPYsU3CC7p7lQQej1y9IpGe7ZuzahebzXWxQP70QB5DgYEPHahOZ7GXTGR2iZifO+nHr98+f6Ufv3u0jrIHyl6qh9o5HLmwyDZVHntrxtyl1mOSTXir9F5r7KzKvHY958bM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722524444; c=relaxed/simple; bh=8vjxRlOStJpYtiSG/bFuQptxGZp+41yfmPpaMWf6vyk=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=H1q+gJh6W1KSThh2238BgJ/uzgozOqhP3vTqceHNg2gwWl9/xgTK+3C9kYtb5HmrfyEp5cP258U8b9Tk8mEVoqiAbWeEzKRw1+iBy8a/g6/gh+2WKZmrbJAgh7djbBTdL1O/RAdE0smIZl0XtrI7pkKYfDFh9ihk6OLWsAETAFg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5af51684d52so7994868a12.1 for ; Thu, 01 Aug 2024 07:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1722524387; x=1723129187; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=icdC39Dfu4IP9ukyz3rqKXCP3UKf4FArmeMHvmnZup4=; b=U2lR+bO1wJNZ8/WdoGSsm9rYMHG8TZBWb9JWoi41Shfownm/fLbOqtcTsIK/+1kANE qhhC5cW1JAK3Do64k8mBr4NW0ZrUmyBcghZSnhTEn7ksvYkdJspjlIaAdvk/+TZq3Lwt 99qcxmvsSsTMrnalkayxykhcQm2szk7RSaE1KcqJOaBzSmRD1naEojxLmkP8LO+5fCvU veyOmbs7GZdUWtz2Mm5lMj/aauik7Bbd2bTPeyjZsGOw7YnQOaLH45g99YX9gTZLF31H abnlzwI6keVvg5xOWnX3hjsftIBgwna37MF1EnrssDuSf1XXgvCN4nGd555paO4+Fode Afiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722524387; x=1723129187; h=content-transfer-encoding:mime-version: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=icdC39Dfu4IP9ukyz3rqKXCP3UKf4FArmeMHvmnZup4=; b=F0tO2wJUNUEOr+J5Om03gm0ysZm/I/P0J9hh+a11XPQBlIcbm3zqLM8453NCHTt5j2 Yw1YLaTaPbV80khx6TNR7dW+bFX0w063zfEAy64FkgZd2ecTswLk7jLHRbyeW/EgK/5l CFpthTaYLSGVxICDFmpYAxhchbam90zeTEH08qywHwiBJJUwRc0IKPkekMZmod0NY4Fd 04X1pAkLxFMupLs+WVnJFaBbK5aKMJm8sM1oUbW+LtMFEHwwj1k5aowH2hgsBayzu4Mb qObH7olGtS+1M+/boV88MTHk5jlERPHww8WMx/n9myK4ncXXvHBdGu6r8lytOUAMbaJo mkmw== X-Gm-Message-State: AOJu0YyCJD/U5jFx6dM4F+rGJhZUmuX3kRFyhHH+LTrTV2gw9uD6UM7R pmjKZHeVPoJNRKqfIU1yFPlwJU6NgyqHAiGh+BhofyL9f3CXglLdtXIGbhqnYbXo+wgA60AAjxw jKud8 X-Google-Smtp-Source: AGHT+IGcwRzuFkHcwnxiu1M67ny3icN1mc/meMn5QxjTfNJIwWmdYIqUUljr3gNkBPlCppqxWLp1tQ== X-Received: by 2002:aa7:cd03:0:b0:5a1:25a5:5dde with SMTP id 4fb4d7f45d1cf-5b7f3eba1f2mr362495a12.17.1722524387522; Thu, 01 Aug 2024 07:59:47 -0700 (PDT) Received: from platypus.lan ([2a04:cec2:9:dc84:3622:6733:ff49:ee91]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5ac63590592sm10252456a12.25.2024.08.01.07.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 07:59:47 -0700 (PDT) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [PATCH 084/125] gccrs: Values shall be inserted in the value namespace Date: Thu, 1 Aug 2024 16:57:20 +0200 Message-ID: <20240801145809.366388-86-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240801145809.366388-2-arthur.cohen@embecosm.com> References: <20240801145809.366388-2-arthur.cohen@embecosm.com> MIME-Version: 1.0 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 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org From: Pierre-Emmanuel Patry Values were inserted in the label namespace instead of the value namespace this lead to several bugs. gcc/rust/ChangeLog: * resolve/rust-late-name-resolver-2.0.cc (Late::visit): Change the namespace for values from "label" to "values". Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/resolve/rust-late-name-resolver-2.0.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc index 5c8d976b417..dc7cde1b323 100644 --- a/gcc/rust/resolve/rust-late-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-late-name-resolver-2.0.cc @@ -151,7 +151,10 @@ Late::visit (AST::IdentifierPattern &identifier) // do we insert in labels or in values // but values does not allow shadowing... since functions cannot shadow // do we insert functions in labels as well? - new_label (identifier.get_ident (), identifier.get_node_id ()); + auto ok + = ctx.values.insert (identifier.get_ident (), identifier.get_node_id ()); + + rust_assert (ok); } void