Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp10271590rwp; Thu, 20 Jul 2023 18:08:41 -0700 (PDT) X-Google-Smtp-Source: APBJJlFs+e4rwNz9GsIGpaW+G+SKWoY9d+/CH/3UJ/z/PZXZasXTGRLoBLPzUTgfEYXRc0zJxzw8 X-Received: by 2002:a05:6a20:4d82:b0:135:4858:683 with SMTP id gj2-20020a056a204d8200b0013548580683mr537118pzb.48.1689901721188; Thu, 20 Jul 2023 18:08:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689901721; cv=none; d=google.com; s=arc-20160816; b=lBVoZY9Qy60SGGRbVAmpKSPKcvrL+Wy5v51IehY1KjPBjSlK1o4viDDEuamFegVdp/ sP60650ryVvzIN4SEe/ZiaffV96Whnic3bZc+a3XnEaos3yV6NZ02QIcmoMqIhNm2AU8 MmNl7ndPN+cYA6NvZv1Rn0yMDB3bQeI6I55Kp413FkUY2d7Ss4yasHc1BiiQWdgy2/gR uHwEeA6G7W1oIAwa64lyem2uAmFASCIvPwqD6OxSFiqCihClmEX61ZLv/NOkXSWbWm3f gbuG12xKsh6evaSt1wF8slpi3UuIF8KqH6Ksnia1jS28fbX2YmgYdJz+sNs5RDZQxkyS Em8Q== 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=8re1DDESpFwS5iE50jeCc4KxITfQ7pjxebZ/KISRzDI=; fh=M48Nkp047DQ57qG9/TGfMDIe12Tt7gV48cIFqTE5RcU=; b=VFvTUnx222qrxcvzKW0OjhfQjrutfYblMNLKvgWOPtcXSeA9VOoScaxBFxo3NBhuTh 2lp5nay7sSZ6pKQc46/0DVxoDnZA8tJvjTAQ4cPbmB95uzIeZVA+Vn+o0koERarMA1yy eKQOoxrwglbnZRp2/2AfqcdJne8bcsHHwSHvfshYrrk+EnWsFEtMXM7BGJPNLXogBV0m aBJ6HzqEhZUZy1OsmcIZ80fjMHCiG9HLDrHrhwDv2l7BaU0uj5VW/L2yXxCyOkiABsER 35WwhDDi8bjggCiQ+WyvcCvMhson6bJhJvdk+fs63l1yLW2GvKLpCmNg1oQhCpmmPksG il+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=HSmPpJXA; 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 d11-20020a170903230b00b001b89b77ce99si2141076plh.458.2023.07.20.18.08.28; Thu, 20 Jul 2023 18:08:41 -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=HSmPpJXA; 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 S230085AbjGUA0d (ORCPT + 99 others); Thu, 20 Jul 2023 20:26:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbjGUA0V (ORCPT ); Thu, 20 Jul 2023 20:26:21 -0400 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 124FE30F3; Thu, 20 Jul 2023 17:26:00 -0700 (PDT) Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3a3b7f992e7so992485b6e.2; Thu, 20 Jul 2023 17:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689899140; x=1690503940; 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=8re1DDESpFwS5iE50jeCc4KxITfQ7pjxebZ/KISRzDI=; b=HSmPpJXAqq+n+Xn0PgOj5d9xWy3K/OO70HmsGzuwRjK25LXMGmVFrEtRqEDzyr7IZ0 Lx6kvjQHnPluFbRtjyvvH5ktR16q5ZHEe2mqXFUEayHF+ZcQknEcVeMFoGJwSvMtNSIJ sk6r9YCO7aj55vyKERsRdorwZkMxmWy//QCHracLvP7XP9UotvD4jllhkecZOipiM18H FVfatieM0mi2WmWmI8Upit3M004kmehcHALyYEQJfWdmWovCS+YiqRGqz0er2IRkrQ4c E6hRJ3XZftiIBr3PibYRaQJWSEvOjFq49BF9GkRzTuQmw2v/Vkr67kAvDx2yZvj64QTT WBvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689899140; x=1690503940; 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=8re1DDESpFwS5iE50jeCc4KxITfQ7pjxebZ/KISRzDI=; b=X3gfYnX9W4tnRwRUCt7fUdl0akAjE6DaRyN214UiCTr/CecbP0fzApE1jVxC/ohIe/ 5xldRIVMnYjlGvEM+fG9QDSrOBe0t3HOGK1kgawRp29AekxGp8oMNJtkDmIz4Jlm/t2V kkqdzAR9WZNRX9KXJflQqTdFVbGZI+sECompx2fdUxpxvukKVYXsA4H6xZBkuJKfWQyj 3ykv0jJjuGYuqlWW3bNztnwqfn6xa2zWTBLcNd2eEtTyZqo5plTHgcHrTxKlmpilSzQk 1XFOWEGMIVKmlVVIHZmChyEcNi1onVVO/LINEVMLpxdeA601IVZOmKaiKCfF+wkuapAS I4Gg== X-Gm-Message-State: ABy/qLZuGyFan8ArOZNeFtNr5i74UFXRIbjeXOHSJzrCTaiCkX+tAsQw KnbEJMW1fTlkyPr/WGTfKDs= X-Received: by 2002:a05:6808:a89:b0:3a3:f1b3:9b8e with SMTP id q9-20020a0568080a8900b003a3f1b39b8emr425039oij.28.1689899140368; Thu, 20 Jul 2023 17:25:40 -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.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jul 2023 17:25:40 -0700 (PDT) Message-ID: <81c02c89-c861-7b50-606f-f9bccbc099c4@gmail.com> Date: Thu, 20 Jul 2023 11:07:53 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 10/12] rust: init: make `PinInit` a supertrait of `Init` 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 References: <20230719141918.543938-1-benno.lossin@proton.me> <20230719141918.543938-11-benno.lossin@proton.me> From: Martin Rodriguez Reboredo In-Reply-To: <20230719141918.543938-11-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_BLOCKED,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: > Remove the blanket implementation of `PinInit for I where I: > Init`. This blanket implementation prevented custom types that > implement `PinInit`. > > Signed-off-by: Benno Lossin > --- > [...] > @@ -968,6 +956,12 @@ unsafe fn __init(self, slot: *mut T) -> Result<(), E> { > Ok(()) > } > } I'd put an empty line here, so to separate each block. > +// SAFETY: Every type can be initialized by-value. `__pinned_init` calls `__init`. > +unsafe impl PinInit for T { > + unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E> { > + unsafe { self.__init(slot) } > + } > +} > > [...] Reviewed-by: Martin Rodriguez Reboredo