From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id C8E90385E830 for ; Thu, 1 Aug 2024 14:59:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8E90385E830 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 C8E90385E830 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::533 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722524438; cv=none; b=hfex4XAjqfsCjiRYvMGgMzMkpYh+BaCmshvXTiVFewplL3W3I9WtBO0ICkYKYUK/LxLVRUk/0ZnAkrN7007/vB1msoT2Zj7ciWkwuy5LRJJnyIUdbvnXa7eIxwSFbcs8PkogxgZrF4qtXb0suOkeNe7BFl+9bh1jMtMfU8NQ2bc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722524438; c=relaxed/simple; bh=ricm/Zz4LdizyPAK8ol6sniANmDrrMN9z/RJ0obT6O4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=WxIRgMrehzacYw/I9tqU84ULpjczC48gveVM86/0CsKlaUhTjFRAKRSmprQZuC2Z9A4hJqsFT+BlDYX8S4MnhdlCHTKl0XuhMPE35dZnnsMvc+73B+9dyuBhnaA/eHJ5doGlkiM213wA2iWYC3HF2xU8nTLvcxrhqsPZSsW5aRw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5a10835487fso10070702a12.1 for ; Thu, 01 Aug 2024 07:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1722524384; x=1723129184; 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=H/cAIeq17c42/SaEmeqUfsK1NYDoroZtpCbAOIv+EKU=; b=g0OxeFa5ZHljuTfZIvbJu08G5haUubx1kyjk+8mp6YzvbIDCizMplbhArJaPBT0pWv aE2hSYdtu2J+4MfBEAyUsSrohbU40R7HbwIgUFdOZOJG38XH5w0zBZx7hPAOGig1XwCj KRFE/xkIYt2NQTWTG4VED1fpen/AquOj4weABCUNO+eZCICDDK2xr136r41XM36DsQZt 5+fMDakxCuswPWWEBx0eM/s2mLS0K7SOIBOHuFN4lXgNK3STxVjeJ3ZezQo9Bt6/p7xr UUWu/KL1eSvlgbDhYvxZnQkfc59gD02ZQmNXZe6eFGg8USTr/TWmWaRdTIDDUY+YRrPb 2wjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722524384; x=1723129184; 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=H/cAIeq17c42/SaEmeqUfsK1NYDoroZtpCbAOIv+EKU=; b=eWrKbmpKLbG+7wFS/Cme0KgPye/jFAmMZNhrL8EFtk9WKCmbfShmoMDilUwJHNWcAs bv8MN68EhuLUjCyOg/JAmB6yIcUyDXu+1/m34iSt0vPqUtGslU50033RKvtUYjHc3k9N 2JYe0t+NMPsfWIMGxjw91UZAvEDqk0zGHuyVh84B1hi72Z1pdXp1ETkzCXdasoJlIsjU yyxmaGjG3xFf3PPuBK6AFLhtHdf4sxwJ6kEhIH+nyrW2wbK3FHGrCVMp6mh+NuGDpsqV UnHVisSxtAT3LsyLgA0yMn0yzQgAxd+7UjcTVtZ+Fc+f8I5Fvy1bNge6Ifo8+YxujeRc DFrg== X-Gm-Message-State: AOJu0Yx5fjZnrZ4jlJ5w5k3DOuWWfUyTUE3H7Kh++M1GHftDPoztmlVD yVIgXoObNHq/ezTTr+l1BCaF7Pafqzvq+I3F87BCqPlsq73vM0oip1B0MSV3gXgVnmch3RUYsXz jNXms X-Google-Smtp-Source: AGHT+IEqfA9iGlZZ5RPT8No8vPmIHeKzsJzfL6VQQMYZWcPCYBnhvt8g+soNvqDHGFam2mPAIiL9kw== X-Received: by 2002:a05:6402:515c:b0:5af:6f52:c139 with SMTP id 4fb4d7f45d1cf-5b7f3cc7458mr395254a12.16.1722524384114; Thu, 01 Aug 2024 07:59:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 07:59:43 -0700 (PDT) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [PATCH 080/125] gccrs: Change error message to match test Date: Thu, 1 Aug 2024 16:57:16 +0200 Message-ID: <20240801145809.366388-82-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 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Pierre-Emmanuel Patry Error message did not match the test from the previous name resolver when a given path cannot be resolved. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): Change error message to match old resolver and test case. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/typecheck/rust-hir-type-check-path.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/rust/typecheck/rust-hir-type-check-path.cc b/gcc/rust/typecheck/rust-hir-type-check-path.cc index cdb506dacbe..b0e52c454e9 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-path.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-path.cc @@ -266,8 +266,10 @@ TypeCheckExpr::resolve_root_path (HIR::PathInExpression &expr, size_t *offset, { if (is_root) { - rust_error_at (seg.get_locus (), - "failed to resolve root segment"); + rust_error_at (expr.get_locus (), ErrorCode::E0425, + "cannot find value %qs in this scope", + expr.as_simple_path ().as_string ().c_str ()); + return new TyTy::ErrorType (expr.get_mappings ().get_hirid ()); } return root_tyty; -- 2.45.2