From patchwork Tue Feb 21 12:01:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Cohen X-Patchwork-Id: 59975 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1828766wrn; Tue, 21 Feb 2023 04:17:06 -0800 (PST) X-Google-Smtp-Source: AK7set9vIs6vdU5/r9UVqVWqQCawCnkvMbAZqVeOLP/kcTN3r7dKqMbd98SdO3YCd+fiOjaTIzqH X-Received: by 2002:a05:6402:5484:b0:4ab:f47:c6e8 with SMTP id fg4-20020a056402548400b004ab0f47c6e8mr3343096edb.21.1676981826230; Tue, 21 Feb 2023 04:17:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676981826; cv=none; d=google.com; s=arc-20160816; b=02QkPv0Z/zDqYPIlVut1ga/fgiAf4qKkpyiOFHKbHazm3mJlHmVvBEdLUT5yFQGeCs eu6c6JvRRnbRjjZdKS/2K4oW52OvHUVouYKOom8wQlLwE06ZMZtPWJf5F72S0IJ3tHAJ NmBQ2XPy3YVsG7p90we3f2wcn8RJYQPWQUfHasgG+AjD+VVVRcdwmPWOSFtUMILO7eiz hxFjGSUUFGPDdW7Un/AGjVkKYJoAXXLIQlt00ZFxW3boysZaVM9doJjRs1GW54C5sRp2 1vnh3PoOpUOozvLOvMQRD7LnsEGSZDe/fAef1hI5Fbykmx8SudXvg/kGRZlIqi6Wq72Q Y0ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dmarc-filter :delivered-to; bh=klE7pGoD1SIEPTpYZuJlAwv0JaPCHEP6htefXjZ+BGA=; b=x9VIm7v20Na7IRmZC0gCoE1jOQtxsyS+4QTryaLsfrDkQ9hSmtDxAbWtfhmWN0Hvt4 GvZL5Rd3zv3j4NByHIgImRbazlJ6/FwVmU8dCnCKehOKhzYCTf2q0xVGp/TZ1rhc65CO W+C/8ruZljUcImwFK1/StDhJW0xXWAdoNY93xlVo5H6g0OZMlOCJWx7TdV388MvIey5f 0VzbrLwvE/29ulFu8hhmaOcI7vBDzssjvLq6fm72Ix9Xpgr5X7Ks6CQk8tjwrV2a4S+x AxHU293yuaabYG7hobpgHQNmzIFTvGOyNgMAq5V95hEuNo1QT9HOOb7kel/NNwa8N3aL X1CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=LRbWVdQu; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id b8-20020aa7c6c8000000b004ace747fdc0si18343714eds.526.2023.02.21.04.17.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:17:06 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@embecosm.com header.s=google header.b=LRbWVdQu; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 01238383FDF2 for ; Tue, 21 Feb 2023 12:08:03 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id A80A23846063 for ; Tue, 21 Feb 2023 12:03:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A80A23846063 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wr1-x42c.google.com with SMTP id j2so3981557wrh.9 for ; Tue, 21 Feb 2023 04:03:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; 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=klE7pGoD1SIEPTpYZuJlAwv0JaPCHEP6htefXjZ+BGA=; b=LRbWVdQu8AR89cP2/eZlPGu9VYQ5W5KDzGQ9jlW7JqbpQ0/tJkpYF1ks2MS508n5bf rmTXsU6ZDLJglfhKc25q6BJ9Ejg4Th6wBnY+JRDyWw405GTQW0RApfrYeHyB5VaTPW2M 9P3sTckWGCONKzs7PT3c1NryAFrTcJGBffYJCcQ0Krt/XgX55eXy31Z+RnTpezXctQ8r 8GBQJl+5CiNueK03eRZH6kwtsjONHas0lmKN/FZkn54c0vtBm34bB4+0RnFkV1vFmqna mBp6AJrr75ElBXZe8DUdrhEVL2ModEgfa3fIE+lFlPlzSn7aLvQrG7Fz6/K/VJCKTAFW SFkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=klE7pGoD1SIEPTpYZuJlAwv0JaPCHEP6htefXjZ+BGA=; b=b5lXkNXIuC+2ZQTYy+a9+EgH0ofETsRz8OjOB78yyr7lj+xsNSdEFDQ/d+9tTzXXWx 9iDmxfBqCGdaE3/Eq9j3QMPwzNdl5gnRPit2rJbb/Qno7kHV3IopjINdJon7UKOcL/Rm lw4mS0bk8FoKGtUcMb4nHGTIkugt+FbmQjkOjUfZdtQWzgyw2sRnG9IymTVqEwg4hggN ZP26vvesTjxytr4uIKbXKG5stnGuEUFcf3zGieiu98KVjjddMwOlGHacyyZx+DTHviYU KCSgsQeyhNWuLIoW9KxlK/Lok4KPX+HKKhQB6IDIFmghlQOtCIpAbBAfPcWI/2HP2ht5 ic0Q== X-Gm-Message-State: AO0yUKUpHIDRVOzOBOvj2+fvrO3cGHZ6USU6d6ZektcBLscRXVMfYuMW W/o2xWC5vcrIMzbnZOggaFgczFe0w8npSzAPOA== X-Received: by 2002:a5d:5a9a:0:b0:2c5:5878:e5ad with SMTP id bp26-20020a5d5a9a000000b002c55878e5admr2563142wrb.33.1676981017984; Tue, 21 Feb 2023 04:03:37 -0800 (PST) Received: from platypus.localdomain ([62.23.166.218]) by smtp.gmail.com with ESMTPSA id c15-20020adffb4f000000b002c55b0e6ef1sm5013811wrs.4.2023.02.21.04.03.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 04:03:37 -0800 (PST) From: arthur.cohen@embecosm.com To: gcc-patches@gcc.gnu.org Cc: gcc-rust@gcc.gnu.org, Arthur Cohen Subject: [committed 018/103] gccrs: rust-ast-resolve-item: Add note about resolving glob uses Date: Tue, 21 Feb 2023 13:01:08 +0100 Message-Id: <20230221120230.596966-19-arthur.cohen@embecosm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230221120230.596966-1-arthur.cohen@embecosm.com> References: <20230221120230.596966-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-14.4 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.29 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758442895255137005?= X-GMAIL-MSGID: =?utf-8?q?1758442895255137005?= From: Arthur Cohen gcc/rust/ChangeLog: * resolve/rust-ast-resolve-item.cc (ResolveItem::visit): Add note for glob import resolving. --- gcc/rust/resolve/rust-ast-resolve-item.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/rust/resolve/rust-ast-resolve-item.cc b/gcc/rust/resolve/rust-ast-resolve-item.cc index e5eb6e491e3..193e6834334 100644 --- a/gcc/rust/resolve/rust-ast-resolve-item.cc +++ b/gcc/rust/resolve/rust-ast-resolve-item.cc @@ -968,6 +968,14 @@ ResolveItem::visit (AST::UseDeclaration &use_item) { auto to_resolve = flatten_use_dec_to_paths (use_item); + // FIXME: I think this does not actually resolve glob use-decls and is going + // the wrong way about it. RFC #1560 specifies the following: + // + // > When we find a glob import, we have to record a 'back link', so that when + // a public name is added for the supplying module, we can add it for the + // importing module. + // + // Which is the opposite of what we're doing if I understand correctly? for (auto &path : to_resolve) ResolvePath::go (&path); }