Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10242650rwp; Thu, 20 Jul 2023 17:31:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlGrGJBrQRgofGLVI7r89P0nz9kRVAmVaDZjP+i7jFFkt9M6LmZhNa9JSbyGhaKKZ9mwc5jQ X-Received: by 2002:a17:906:1098:b0:982:a454:6d20 with SMTP id u24-20020a170906109800b00982a4546d20mr358452eju.54.1689899472168; Thu, 20 Jul 2023 17:31:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689899472; cv=none; d=google.com; s=arc-20160816; b=yoNIZLp45RAV1+fhIUWJ+q4SPteVaKeCM8zGfRCKv1iEkg/U0RkARn+laKZ/ksRqVZ VJuQj5QtIeTtU7JLsq/YHYVlX/8cKbMdoVf97qSDYJBNnj+IPp0UishDJSRtuXNjjaz3 hftm9Tode5OcdigqCchlIIa94fjFLuBpSkiR/Ej1jAPym6xvEWM3JWsR2wLR+U4zwNH/ 3oPcPUyKCH2vCVNNQMG8l8yxrdl7a+i/SXof4ZXyrzwV1wUcCrRdmGNEZ7Da8B1+Sqkd sWM8dzyemWm5fA8XQTzQvqYMkURTe2yR77WM3VTSu5IC3i+GcAGaGWTUDMNBdIUn2Oam TbEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=kKQ1SX7sz20Rq+RgVuW3lmkwQjRCN042BG35SDexWJ4=; fh=QIytb8Pc/tNQKCXmppbqLtpd0hrzmewt+SvaGVZrVJI=; b=AQAxPhZmJFa/8HN6W0BOVG76Qv7ZLnUbhFGE1Jc48VfTy+B0AlzQFK5JGY2OgyOYp1 nX04tN1jTFWzwCe8gJaPFgoRHKZ7G+WDn/7zPYjiyqQcqbVrCtlnQlhko+q5LLVjEVRe 82JDHkWmwc6kA/jhWypfFgzL2wvh5OHa43uj5dYwsCEI2FRXeWx4Lx8wJWhbPdKc8tAq N3KhbWIJDmQSu3wVYbsmcoL49TyCbvDsxTfXUswIzhlvttf1+jC+i4yxu11KO87IzVBz N3ArnyAK/PXnfryQX6j6XsTmVRayAd2N30ICpNqd1yLAuXa1Nt73OwCanWJmRFMwkPfD MKTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=C80m90DQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m21-20020a170906721500b00965cb784a27si1453338ejk.699.2023.07.20.17.30.47; Thu, 20 Jul 2023 17:31:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=C80m90DQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbjGUA0X (ORCPT + 99 others); Thu, 20 Jul 2023 20:26:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230029AbjGUA0S (ORCPT ); Thu, 20 Jul 2023 20:26:18 -0400 Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACBC130E4; Thu, 20 Jul 2023 17:25:54 -0700 (PDT) Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-56598263d1dso975432eaf.0; Thu, 20 Jul 2023 17:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689899132; x=1690503932; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=kKQ1SX7sz20Rq+RgVuW3lmkwQjRCN042BG35SDexWJ4=; b=C80m90DQz974zcdRW2gPrYhnXnn+FBLjrMvye70Jb0fSYRaYKkftFOoP/ktiC9zbXs VpJr6USIzxdJSIMDXhuvW7WjLYYtnSdmviaBZfyw8OAMP//KMeX0JqYC9Z2U5LpskA3J X/ZH0kb4tI9s+Q6M5OQnNsQUSD6V1GBObgVAnCe5l6Jlt9iC6oXJO0ONtmMKYBnVvfvg UTV+C7NIFrZEG6dQztQkmHNmlmG25OP/4A6LzOgRjAQNO0SEPNZesfsyrjQB0fmdsoN5 AsBu1FdasNg4Z1An8D31djLM2dWbzhm+lzh/it7Pk5ZE+6j48ytkrctkp7hLKFZ5tPqg RXMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689899132; x=1690503932; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kKQ1SX7sz20Rq+RgVuW3lmkwQjRCN042BG35SDexWJ4=; b=GTR829kx+zyRlbUqbpsYdW49TyY/xFo2SjC4FocOxJT3oTtbrbX4dodhfmBeNdgar0 uBa0kTDHbbyK8g+HJEWahrLo0VSx1dChjXukyFl70SjK/Z/HEFdJXLf3VFTt1WKXlDVN 8PWg8SlqNzOKQJ0pNiZ4XMtbZI1Wkuk8RYu1x98Dya5TiesbmvtNP+2n6annqpm0lZM9 D5RvcxiXSed2u5T0TvS2Mqfg/b6fdUNiREUzB4OMCSj0uqyepEfSdP/BaOttQTRQGgJV PLnGd9Y+Fw8wHZhd35q2pT+QnmkoTNNCrr54NkFRK0aF/m1h0+4kgJBqC6BDH7zqPirA BqnQ== X-Gm-Message-State: ABy/qLZn/LSYHnadtgL0ldWK0G5DV4huM9Se+qj7a3XnzG2BCSDjL8Mw eej9xBoY/f3EOfhEmJXj7R0= X-Received: by 2002:a05:6808:1929:b0:3a3:7c33:9a0d with SMTP id bf41-20020a056808192900b003a37c339a0dmr609273oib.48.1689899131926; Thu, 20 Jul 2023 17:25:31 -0700 (PDT) Received: from [192.168.54.90] (static.220.238.itcsa.net. [190.15.220.238]) by smtp.gmail.com with ESMTPSA id t25-20020a056808159900b0039ee1de4e6esm928210oiw.38.2023.07.20.17.25.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jul 2023 17:25:31 -0700 (PDT) Message-ID: Date: Thu, 20 Jul 2023 11:02:53 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 08/12] rust: init: add support for arbitrary paths in init macros Content-Language: en-US To: Benno Lossin , Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Alice Ryhl , Andreas Hindborg , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Asahi Lina References: <20230719141918.543938-1-benno.lossin@proton.me> <20230719141918.543938-9-benno.lossin@proton.me> From: Martin Rodriguez Reboredo In-Reply-To: <20230719141918.543938-9-benno.lossin@proton.me> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/23 11:21, Benno Lossin wrote: > Previously only `ident` and generic types were supported in the > `{try_}{pin_}init!` macros. This patch allows arbitrary path fragments, > so for example `Foo::Bar` but also very complex paths such as > `::Bar::<0, i32>`. > > Internally this is accomplished by using `path` fragments. Due to some > peculiar declarative macro limitations, we have to "forget" certain > additional parsing information in the token trees. This is achieved by > using the `paste!` proc macro. It does not actually modify the input, > since no `[< >]` will be present in the input, so it just strips the > information held by declarative macros. For example, if a declarative > macro takes `$t:path` as its input, it cannot sensibly propagate this to > a macro that takes `$($p:tt)*` as its input, since the `$t` token will > only be considered one `tt` token for the second macro. If we first pipe > the tokens through `paste!`, then it parses as expected. > > Suggested-by: Asahi Lina > Signed-off-by: Benno Lossin > --- > [...] Reviewed-by: Martin Rodriguez Reboredo