From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by sourceware.org (Postfix) with ESMTPS id C81D53857B95 for ; Tue, 30 Jan 2024 12:11:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C81D53857B95 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 C81D53857B95 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::32d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616706; cv=none; b=O3mvoPp48LiLY+7H0j3mYR3aGmmyBdTCHRURARykEF7twg4gS8rnEWr0bw8u6gv7Ll31eQ5Id9ohGPvR/v3Xfg22YdCeOcycva8CfupNUmv6ZDITPTD5MY3aCugbBvsf+w6HtliRCggoLZX6afpsOlZPCLT24XKfv1aZt2ogBEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706616706; c=relaxed/simple; bh=GyOCtN1nI3fsNEIJ29hgyTjw2Ha1yrjAh2NplTYbg4Y=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=goN7AuIFM1/CsxDtzuHT0ttYHxuFpBsMfc2Yxe/UjD/irS0aNksr6HmQelvimTVcgSlkUdLEByjUJwRv9rbUXWIMpxM34Grxi+FVXOwtXpX3SbQ5gZMzo+Eoij7kPk5ls8zMh9RpIFfQgy64A/upN6jeaTjamdw5+QKVH8NOioA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40e9101b5f9so43122515e9.3 for ; Tue, 30 Jan 2024 04:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; t=1706616680; x=1707221480; 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=BKw4sa3FTLYF2rhnjQmhSXdN1b9XclNq5ftM6eb8W9Q=; b=LTH9I/KL9LozJkXLRVOVu3EHxVcgaH3RNSk9sDE4iTD5ZFluYJOO2OTx6saT4BOzue GieB8HIUmb9HRNwm7wdRthJAboDTgDwqUKxHRk/bp6q1LE1A8CS0ggrE8wL8107dwoHf AVcyKyHzg34AIlPoNAY6qaMuBY1GZgewagH+ESb0qidt+eJV28yZ/4l9KKEp3RabcHYg xPf8J3Mq5ntWEKW+8XsJq+nSbWKj4ZeGFFvUWhTlImqj2FXDwAhivKovaQ8VyY8oPI9q zAvuVfaOq04IZfzUdvqMxh7w0l7FPFBIeltHZjCZAYbT2itHWGjBEHWE0C6Ov1egkW+X 0ZwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706616680; x=1707221480; 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=BKw4sa3FTLYF2rhnjQmhSXdN1b9XclNq5ftM6eb8W9Q=; b=a046+ODXsA9kH8zT/Kl3GtwGimWlYJxuJWB+XqYeL3pbt143/mlefUmu3KKJQHSve3 bZaQrCU/LTxcwVrcG9wJsHdeq22OlLhTcfvrixC4cLjibKpHv+rENuwh1TabQkq1r3lv pSoRaBXdwG5VHPs0RhzG6B+3fFLh+QSRsATY5nr/PYfcY6snNEIwMbhrXsYy5Z3a/KfE 5ERFqqYLwGpt5xJKnizL4mOt/+ZPR+u1EXc/2GNGJrV/ywuAfaYiQwl7LHCEg7SkLTr8 hxzBBJ0w0P8/qXnZvWR6jY0ENqUtwtg3a7/73WeLksrUtIggNEaEOov9+/0SzTAI4NRW GfvQ== X-Gm-Message-State: AOJu0YwLKga1BjOXbeomYeXY7ySHiCkgWmouD5M8pV1jk4gIUsjYH/k7 /fSSEvaBcHFDw8OdWdaHorg5TXoCeyu+095eIxA3yYKNqa230F5c+6uxabPlSw== X-Google-Smtp-Source: AGHT+IG8YGXgjWBu8GKetMO/W4lRqcT541+XQR+Gu21eauJznh3+mbruLXOVfGyfJluo+5hzYjakqQ== X-Received: by 2002:adf:f2c2:0:b0:337:7b14:d9fc with SMTP id d2-20020adff2c2000000b003377b14d9fcmr6410169wrp.12.1706616680671; Tue, 30 Jan 2024 04:11:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 04:11:19 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen Subject: [COMMITTED 040/101] gccrs: toplevel: Add comment about running the collector twice Date: Tue, 30 Jan 2024 13:06:56 +0100 Message-ID: <20240130121026.807464-43-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> Reply-To: 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 List-Id: From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::insert_or_error_out): Add documentation comment. (TopLevel::go): Likewise. --- gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc | 8 ++++++++ 1 file changed, 8 insertions(+) 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 fbded3e49e1..b9d0bc7c0ac 100644 --- a/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc +++ b/gcc/rust/resolve/rust-toplevel-name-resolver-2.0.cc @@ -43,6 +43,9 @@ TopLevel::insert_or_error_out (const Identifier &identifier, const T &node, if (!result) { + // can we do something like check if the node id is the same? if it is the + // same, it's not an error, just the resolver running multiple times? + rich_location rich_loc (line_table, loc); rich_loc.add_range (node_locations[result.error ().existing]); @@ -54,6 +57,11 @@ TopLevel::insert_or_error_out (const Identifier &identifier, const T &node, void TopLevel::go (AST::Crate &crate) { + // we do not include builtin types in the top-level definition collector, as + // they are not used until `Late`. furthermore, we run this visitor multiple + // times in a row in a fixed-point fashion, so it would make the code + // responsible for this ugly and perfom a lot of error checking. + for (auto &item : crate.items) item->accept_vis (*this); } -- 2.42.1