Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4883812rwl; Mon, 3 Apr 2023 10:58:16 -0700 (PDT) X-Google-Smtp-Source: AKy350b4wTsdbh+isynfhrOsh8FrujFa7otTZhvkhglF4dXPtxqVJmwoPKPU//0MjNI8geB9uvrF X-Received: by 2002:a50:ef19:0:b0:500:58d8:b339 with SMTP id m25-20020a50ef19000000b0050058d8b339mr76425eds.20.1680544696215; Mon, 03 Apr 2023 10:58:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680544696; cv=none; d=google.com; s=arc-20160816; b=JZna1fxXUu2gGuiHlta0yZjyqZc8rwUIC7AKAAswrgQP1883n0X47M87Cef/5J1HRX v9SMw7KA8BN5TF1ASGp9WhkqiiQfC9b6y1Oa+rqcSDK4fHAjt+vsOIGlwMTvpBCrxiIa Bk/fByQx33G7G9dlZ3zIJ66V73Q4/wetSB4FamqA/XgHccqlpw1EjsF+nEo7D+o/BQE5 u9m/woNUSY4zuzgA3seqfJcMTSi6BCcMyHL2lF2zak+yAOUKeLsLAJvqcVL+KDYplMem cBpopha2MjWMyUuLpEB0L6vp83h0qE2gmgs2AFzWhn4+03orjLGJ4dMNleT8/jAHAp20 +sTw== 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 :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:feedback-id:dkim-signature :dkim-signature; bh=zquIB4O70SLQT/QPGcACFv3gsmoOH4kMknnBEMc9nds=; b=Pe71jZ5Mwsu0RU2qnEAWH1g0Cjldf1FacH126MrT1hxEkZhbJkuYVZvOYbe5Je8mOc U6+DHA4sD5NryXmQGH7/otjP5CERY4aYwC7HTN+L59WfSSNjYO5V7RACkhW/0Fy16XTj ycS+Zt0oDZjjeK1RV+N35Y1nBUYdce0XW2J+a1VLNDvK/vw/7v07vU/D9GIjXmp3Wb7a BuEwoJM/y80BvdDvOGqwcxR9uzogE9WJ+ezcse0oJT9QQ2yP83kwAdmC6zNLUSiErbpH AwZIm5J3Uz7zayEpyHfqV9+qoSRkAJ3u1GWgKcSzJu96NZHg1+H8RiCV87A0bGXH75tE 5b+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ryhl.io header.s=fm2 header.b=B60GAjD9; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="GBIr/QT8"; 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=NONE dis=NONE) header.from=ryhl.io Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w5-20020a50fa85000000b004c1190b5abbsi74832edr.184.2023.04.03.10.57.52; Mon, 03 Apr 2023 10:58:16 -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=@ryhl.io header.s=fm2 header.b=B60GAjD9; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="GBIr/QT8"; 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=NONE dis=NONE) header.from=ryhl.io Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232955AbjDCR51 (ORCPT + 99 others); Mon, 3 Apr 2023 13:57:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232894AbjDCR5R (ORCPT ); Mon, 3 Apr 2023 13:57:17 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B8A73A9D; Mon, 3 Apr 2023 10:57:07 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id A8CCC5C0050; Mon, 3 Apr 2023 13:57:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 03 Apr 2023 13:57:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ryhl.io; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1680544626; x=1680631026; bh=zquIB4O70SLQT/QPGcACFv3gsmoOH4kMknn BEMc9nds=; b=B60GAjD9jzWAK6fJX0WJP2dXxBM4Q97zwSQSJp9q/rahF/nL9M3 CXPonV4yiWQeFht+LCghiTs7b2sK1ORSr1BQ3dYjX2jmeM3Azh53nVAmwBdrSgyl 3wFLgn/ILoaOoEcdZ30CbbKgFmBwlGpW2b43fgQu+7bAYT6tgxpPFBB6Twc9SDex hdAcPe8hbGPFs9iXATZKaIxi0rlqXIrCd9LedFKFQQXAQcR3RFzJNFxaF21bAbRM uYtn1ky0QIFwt4UveZrCY82J9oY6wysRUIP8UUAUzo9ePCE+VjtmPlXuzoeFPwaT kya1efmE67m1ZaDrLVItudBfCDzj074k68A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1680544626; x=1680631026; bh=zquIB4O70SLQT/QPGcACFv3gsmoOH4kMknn BEMc9nds=; b=GBIr/QT8ZO07yJXys6q/tRl0kwanzQMUAgKlPP8kJUXBdz/A9LO f9uLTNvrlAXo1HrR3MJ+MSwpgbW7bqs4QgtjagRXaQZZ6wLmJK4XTFTFxK552nry bA9aZXwqFgPY+QqRvjxUlR0b7mnmJq5B+tfn/T6NEtuKzho4uh2RX+c/kb4HNXZd IylElVnjWTAqD5XbVj9UZFEk/ix3ewZijWdUSW42X7+76T0+sScieTT6UlOnOZIo vatm1PYMmvQjHluQiieuNRlTLr+tzMy3H9ejzUg3ZUO4s9srfBpIDsPlDTBcw2ua bUmmcW9+Sx4ETT5CZNDXPvW8gxlE3a3JkBA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeijedguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefkffggfgfhuffvvehfjggtgfesthejredttdefjeenucfhrhhomheptehl ihgtvgcutfihhhhluceorghlihgtvgesrhihhhhlrdhioheqnecuggftrfgrthhtvghrnh ephfehueeileevjeefkeetvdffveffudeuhffgtedvuefgiefgiedvjeegvdejleejnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlihgtvg esrhihhhhlrdhioh X-ME-Proxy: Feedback-ID: i56684263:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Apr 2023 13:57:03 -0400 (EDT) Message-ID: <62df1021-ad53-9fd9-d8b8-cc7a21ca36a7@ryhl.io> Date: Mon, 3 Apr 2023 19:56:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 From: Alice Ryhl Subject: Re: [PATCH v5 07/15] rust: init: add initialization macros To: Benno Lossin Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Alice Ryhl , Andreas Hindborg , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=c3=b6rn_Roy_Baron?= References: <20230403154422.168633-1-y86-dev@protonmail.com> <20230403154422.168633-8-y86-dev@protonmail.com> Content-Language: en-US In-Reply-To: <20230403154422.168633-8-y86-dev@protonmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 4/3/23 17:45, Benno Lossin wrote: > Add the following initializer macros: > - `#[pin_data]` to annotate structurally pinned fields of structs, > needed for `pin_init!` and `try_pin_init!` to select the correct > initializer of fields. > - `pin_init!` create a pin-initializer for a struct with the > `Infallible` error type. > - `try_pin_init!` create a pin-initializer for a struct with a custom > error type (`kernel::error::Error` is the default). > - `init!` create an in-place-initializer for a struct with the > `Infallible` error type. > - `try_init!` create an in-place-initializer for a struct with a custom > error type (`kernel::error::Error` is the default). > > Also add their needed internal helper traits and structs. > > Co-developed-by: Gary Guo > Signed-off-by: Gary Guo > Signed-off-by: Benno Lossin > Cc: Alice Ryhl > Cc: Andreas Hindborg Reviewed-by: Alice Ryhl