From patchwork Tue Jan 30 12:06:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 1892811 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=S0vfTewh; 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 4TPPM16jyRz23gZ for ; Tue, 30 Jan 2024 23:17:49 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E34813857725 for ; Tue, 30 Jan 2024 12:17:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by sourceware.org (Postfix) with ESMTPS id DCE913858000 for ; Tue, 30 Jan 2024 12:10:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DCE913858000 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 DCE913858000 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::236 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616657; cv=none; b=Vo0s4dQkC4Ac8cdXumLqi8IQKe/r9qzatO/Wlx2COH5STyZAwaw2MVlB+Jnn+yIQ65xXiRCeKuCHlUYjhWzZed1lFQGIZyFMbWNTQcnPZcABCeXY0ss3EcrgbyZUYbdFbbYNMtagMCZJXRi1pvod1+O6C5ExRlIwGnLClcVnMFs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616657; c=relaxed/simple; bh=rkkQtLfG9Cc8vbbSITDgLNbuoKQIi8V40f1u5tvuEH4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=I85vnKojKpTP8UJ4RUp8ePdg8RPGDMwsZK1CSyeRNAagZ8ODJ9p09kK4Ktqd4VvigadzI+yVzORmRWD7RsyudVXQTmIMEDjWAZnBCvpJobp0HKHPIugQkYIFcndIpBG1lp0+T0FDz7lDuerhdugKXihAiW9jJujfGz06kB3WB04= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2cf45305403so37534641fa.2 for ; Tue, 30 Jan 2024 04:10:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616651; x=1707221451; 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=RsFUMNZGNUmy6CpSPO7EBBkfBGnB+T1WGXUzR7rBCcY=; b=S0vfTewhdaoPdRoqiEGrQPLIHnPaFcdAarrJzPs9FWqY/vSoqnvBMCDEXVgDZeaHOe vv8fJBrtSg4FFZbt8PfV9KSPu+IuC5DRJgOGTVmqLN/cdQOxKXmRzYbk+Q7O457SAWSG x7ACZ0rNuNXSrSYe5LJWOzFDRzkPTIbwsF3u8M15cLYKe3X5YfkhUpz25Tcbc0vaXOvY t10N7FvBllxdSpdxzni+lEAae9fA90rPzgivaOfYfqJkAukN082srRtsbJjTYQvlEuNU ex5Wl4sMPIf4z4zpaLs55Obpra+SjovqIhtheg7upSMVKd+x4gjvKY3MIcEZmj+UVJlJ rqAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616651; x=1707221451; 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=RsFUMNZGNUmy6CpSPO7EBBkfBGnB+T1WGXUzR7rBCcY=; b=ByoLpU33tNfuLYpDLqeRWkdJGpk65n+09zyb5aFw4oC5kNWYGmxicvUd5wcYcBUxQt rnb8DGVAtqRlXQxljoyFSHfaaDpe7dVi6aoQhc000STOHYvQv67vhFhuJcfY8r359cHg wDSK8xpipS4Qb4YmaMXDLAT2VCFppTXYRhUR9biThVhHfHP2/h3BjHxL4GnWOYrlrSEV OlzUhQZDNwaQ2my6ZqI/AR5igPCM5wN0/Oa8hYH0SHowK0RyhLBSB0BTaGYM7mQ0cvGO TMBN/igMnqHDiTdvvw8JqC9RdZiyoEqi9ekQDmBdtJ7qDY2floOzhG8X7UvNh2ZplTrY iTRQ== X-Gm-Message-State: AOJu0YwrSkBCKe1z/40BqmtBCBM97iyC6Hcho8eqsIH/zpL5NZIYhv0M +DIY2TnyIx/4IDdvaEiEqSPOngTMsu4EN5zntKjwKW73FJrB3xvU7NiXgx2QzP62cxtJwmiyGjp 3Kg== X-Google-Smtp-Source: AGHT+IHGYWoHnSytoG+hB9KrOLPt87LrLH5IUaeTb2FxtUX6tihkKAUvGbGLdm3KVbQLYxtuHU0Fsg== X-Received: by 2002:a05:651c:104f:b0:2d0:480b:8d76 with SMTP id x15-20020a05651c104f00b002d0480b8d76mr4143404ljm.47.1706616651509; Tue, 30 Jan 2024 04:10:51 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id f9-20020a056000036900b00339307d9d31sm10569894wrf.112.2024.01.30.04.10.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:10:51 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [COMMITTED 003/101] gccrs: Fix error emission for self pointers Date: Tue, 30 Jan 2024 13:06:19 +0100 Message-ID: <20240130121026.807464-6-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 X-Spam-Status: No, score=-14.1 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=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: , Reply-To: arthur.cohen@embecosm.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org From: Pierre-Emmanuel Patry Self pointer checking loop condition was inverted, the latter was therefore never executed. gcc/rust/ChangeLog: * parse/rust-parse-impl.h (Parser::parse_self_param): Fix the loop exit condition. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/parse/rust-parse-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h index 0ae89dc3907..1ebe1ed442c 100644 --- a/gcc/rust/parse/rust-parse-impl.h +++ b/gcc/rust/parse/rust-parse-impl.h @@ -7129,7 +7129,7 @@ Parser::parse_self_param () for (auto &s : ptrs) { size_t i = 0; - for (i = 0; i > s.size (); i++) + for (i = 0; i < s.size (); i++) if (lexer.peek_token (i)->get_id () != s[i]) break; if (i == s.size ())