From patchwork Thu Aug 1 14:57:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 1967813 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=WSJbZJee; 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 4WZXvQ67Chz1ybV for ; Fri, 2 Aug 2024 01:29:38 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0E8D03860C07 for ; Thu, 1 Aug 2024 15:29:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by sourceware.org (Postfix) with ESMTPS id 1BE9C386074B for ; Thu, 1 Aug 2024 14:59:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1BE9C386074B 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 1BE9C386074B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::532 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722524426; cv=none; b=F/dnthkCWX9EsAM3SJXHXlhkzGQbRQX0f+EtBlLWjv0au+IjpwLtW5AHd7GkMweAXNnkr5hOD6Ik0s+/vZcZStj+LsshjVl5oSJ9qp52jE4welRTJgkjYwrxklAWRxoex/FignNdQfLs0GcfL7wt++pEp81KxWHuEfppBaAtPNA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1722524426; c=relaxed/simple; bh=sxRvuOi8jLajf6ekzYY9jQ6+i//FRQWEskzynJDo3GY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tb8bpKkkH+g3sL9au3Rq2XKv2HBTDL+qTO6IutuKVgUC+QS4KNAzdJftEiK55S0barBC5yTdi133sEjuaHsvG6QV9hCjWVI8kcf1BBuppB4tbHVj9+jsI0fDb49mkQtj4V9PAnkL6lJ2hYU5sNGK0w2RgsyxrVw8N+ZRA47bePA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-59f9f59b827so10437544a12.1 for ; Thu, 01 Aug 2024 07:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1722524378; x=1723129178; 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=GtyFyrhtY9tKJjRke7rgWY7zMASUFweSn7+c2oc7oVM=; b=WSJbZJeenioyskiZZMheXlp4SfkoxnBtOQUncSuOovHu8kqVd7aZgxNrorxVATAl4C mv/3Chf3JKYix799KqDzXq6LCzYSiVI6bo5xBqpK0hUgkjsAAb1esomC+bZNRGVN2l6Y M5Z3Tp8r8jqOjYoG7DtTCURJdAbiC0SzQIdjeGMQbNvjVAWxO5FvNihC+HwYjp6EjUFA 3Avj3IS1i/qoYgg0e2tIRs/iO0OQXuOk9vVPN5KNfzUi4t8cPzZ6UgCUmR6bo2+nuy8n G6fU9QZ/vYVJyB9GWe9rEafMt5bcAZrHorDxxfvlTYrMktdJjZCmMqp3kq2H9MIOkAGz ij5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722524378; x=1723129178; 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=GtyFyrhtY9tKJjRke7rgWY7zMASUFweSn7+c2oc7oVM=; b=Vkmt6cgJDiE3Fx2Vjr8ynS3+zX2wXw6SWDaquz2Smhiltj4/MXLcl9swDN1jeNiP9P BAhefgbeRpvJpuryzSDZu2pYQCs+EwRyDKwo6eYDn7mUGsOg6Rl+Mg852aWdhHgiP3XS on20NW6qYXsKvk8VsbR2GWgkg3TRNFeFHXuaceUq63bP1AIEBNNb91pVYRzxenq4C5gf l62CJR8DgWThZid0phcOv6Q6LRJvHP83sEDlP55jmschYtuIKxsaSutqhiwoq3zPVUYr lS5meClnwtFDnR5SD2WpVrxEjA+fEIZyn1S4jI/tJxzxJTLcJqIW1QyjEQuOxYmn1b5E ZtNA== X-Gm-Message-State: AOJu0Yy2DiQBobbHpVHRl0mmDAUPIe6tfv7Es5sR495lkxd9un8QwCGz +5oqi7a3XXQQmGTiFzR896vnbGG57z4jTRBffewi+A2Q2roDsYAZmfBQ+GJyT8iYDpyH/euRdx7 QQYm3 X-Google-Smtp-Source: AGHT+IF6oBWcu0jrKIEZv5NHI0C3f+MuVBtMMKT2/EpU5NQZBmYJJ16liN3ZUy9FF6/bJpzRvZE5ig== X-Received: by 2002:aa7:c3cc:0:b0:5a0:e62c:61bd with SMTP id 4fb4d7f45d1cf-5b7f5413b5cmr393753a12.29.1722524378513; Thu, 01 Aug 2024 07:59:38 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Aug 2024 07:59:38 -0700 (PDT) From: Arthur Cohen To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Pierre-Emmanuel Patry Subject: [PATCH 073/125] gccrs: Add modules to type namespace Date: Thu, 1 Aug 2024 16:57:09 +0200 Message-ID: <20240801145809.366388-75-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 gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Module should be added to the type namespace in order to be retrieved later. Signed-off-by: Pierre-Emmanuel Patry --- gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc index 3b1ccc1d3c5..5e6f5e9bd78 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc @@ -72,7 +72,7 @@ TopLevel::go (AST::Crate &crate) void TopLevel::visit (AST::Module &module) { - // FIXME: Do we need to insert the module in the type namespace? + insert_or_error_out (module.get_name (), module, Namespace::Types); auto sub_visitor = [this, &module] () { for (auto &item : module.get_items ())