Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp30990rwd; Wed, 17 May 2023 14:09:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4z98pYCl4JvrmS/hIJrbtBj6MMNM54Yt2XQoC/M4gHrYPvgYEVNpApubHlr6BUEMGcmODa X-Received: by 2002:a05:6a20:3947:b0:104:70cf:eeb8 with SMTP id r7-20020a056a20394700b0010470cfeeb8mr26551314pzg.33.1684357779135; Wed, 17 May 2023 14:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684357779; cv=none; d=google.com; s=arc-20160816; b=AC4o4jpL/eejMFZqivOsSstYvZyyjMPH81dlqA7VuKC5snYP4Ara77fxwvUnEFr9Cg XvFh6MFgZh8W8fvQOYzgVq2i6rGUm76lJRyQdoVTLVmd+qyqJBMUkPlmIvWSGPBkj1W9 VCVnGm4nWeQ40mDYVAItBALjx67DywasCW6xqfM+f7a5tyNtHgV3gXiFfVC3/FaEsZ3Y ZpJ75i79M5IFCaXjUGOSzp9tMKBpxvBogxWjgUwZEkbG66aOG59o4VgSW0eHP5F0m1mf lPVnc2Gliqg8ZjyFS2lBcrV8ie/1zCKPpR8KbpjbKS7nVEzHIXVBCNu2zK7r+0G39uQN gX8Q== 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=IKmc4/mY2T8M2vtBoa3KRIY5AIQ1sNsQWDEPH950Scs=; b=oe6BAUJK8xL555n8rvuQYQePFTSmhAlQ6r1tlhlx19Ro7f41TpcFUzbB8a3sdqQQEj Ipw4s/MKk77pZ5jK4ZXq6/TfQr9B9JrIEb2LXhMDOjL1IEhFn36UAeqsmffG18Ms0Ha7 SsAR5dii/mgosiAcU5uN1cSVBakqvj6IhfVEAKS6TYNCR2jOeunD4hySSjyQNxrRfmF8 9NnPPQHaNQ0KQfQAAJw72L7hyNFf2X5LQ2N1xD/u9rGqIAkiK/2fllRqTKaNtgPWI/eS /yC9ahVq7zqqqUCz9ozyu2ZSCdiG2x/qy8eY/4vXzMbxMXsVemE4xe01AAWnq3t1IdZC 7HEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=eUGiJbnf; 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 n2-20020a637202000000b0050be719abc9si20940158pgc.167.2023.05.17.14.09.21; Wed, 17 May 2023 14:09:39 -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=eUGiJbnf; 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 S229732AbjEQUmc (ORCPT + 99 others); Wed, 17 May 2023 16:42:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbjEQUmb (ORCPT ); Wed, 17 May 2023 16:42:31 -0400 Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7320A30DE; Wed, 17 May 2023 13:42:30 -0700 (PDT) Received: by mail-oo1-xc2c.google.com with SMTP id 006d021491bc7-54fd9c0e435so555396eaf.2; Wed, 17 May 2023 13:42:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684356150; x=1686948150; 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=IKmc4/mY2T8M2vtBoa3KRIY5AIQ1sNsQWDEPH950Scs=; b=eUGiJbnfLgkPtl6HyfdqGOEGxQmhF6+mgHDX4SBK74DqCsMAtewI0AtjeOiTs3oNqq 4DB7ue0e5qRJccB4bfIXxaZyaPoxol+uXIQfhHJf2LkbDwxCV9fMguKjOXpb4uQL3pPM dIZKc1l6DfNpP4fum/8/L07J1kyQSb7rR03oaAfGT/fy2PpYT+WRXnIW8ODOgBYgOLhQ MOpXPBwJ3D7sdNEXc0wsZlJ7/3dNQLaKOf68ifgkOjxwE0c1c8KECZ00ltgkejzykvx0 M0UXVwBqnwENbA8nfmusa/2ON7UtyaA6xxzfg87HGQX9qnEfLh9zntDfeFNqnAdiRyuO ZNPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684356150; x=1686948150; 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=IKmc4/mY2T8M2vtBoa3KRIY5AIQ1sNsQWDEPH950Scs=; b=GgjIbS09KIBwqH8m0HTB1l/UEirfdmpscNCTHpm5rLqKNh2k5kMh38exAopZG3xx9x KM3GDjFtBqhgbfG+xEZ0q9Z3U9GwHJjjrtLJiY3XMe+PY+9khTujD90AbuG71vJpuiHN XFPMfhQ8uCoS9Ga1lkzGeVniu7vsOEd4/vZkC1GPv26vBP8NXK9uj8fV2EsX08m5e1i7 RfIH2FbsDz49codA5gUm31/IpgFe+5aVRgWa+ehkvRCPOYdo7IkfIUh12SHToJxN6L6z 1OEerayqx+vqPeD5K3JvEffRN4y1Kqusd2zwcSYx9eKhE0YZ/sR9g2dtOptuDtCZbZ/C 69Hw== X-Gm-Message-State: AC+VfDwFUnu71BSl97ib/AyzX0BUUM2U2kn2e+luBtJoEoDsRY1KMQiw /6KdK3fgtKBfLrXp3W/hLKk= X-Received: by 2002:a05:6808:99c:b0:395:7577:1533 with SMTP id a28-20020a056808099c00b0039575771533mr39910oic.37.1684356149776; Wed, 17 May 2023 13:42:29 -0700 (PDT) Received: from [192.168.54.90] (static.220.238.itcsa.net. [190.15.220.238]) by smtp.gmail.com with ESMTPSA id q66-20020acac045000000b0038c0cf168afsm10424955oif.7.2023.05.17.13.42.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 May 2023 13:42:29 -0700 (PDT) Message-ID: <6a8183b8-0e81-9f2f-f79f-74ca5beb3ef4@gmail.com> Date: Wed, 17 May 2023 17:42:22 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v1 2/2] rust: sync: implement `AsRef` for `Arc` Content-Language: en-US To: Alice Ryhl , Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=c3=b6rn_Roy_Baron?= , Benno Lossin , Will Deacon , Peter Zijlstra , Mark Rutland , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, Wedson Almeida Filho References: <20230517200814.3157916-1-aliceryhl@google.com> <20230517200814.3157916-2-aliceryhl@google.com> From: Martin Rodriguez Reboredo In-Reply-To: <20230517200814.3157916-2-aliceryhl@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/17/23 17:08, Alice Ryhl wrote: > [...] > > +impl AsRef for Arc { > + fn as_ref(&self) -> &T { > + self.deref() > + } > +} > + > impl Clone for Arc { > fn clone(&self) -> Self { > // INVARIANT: C `refcount_inc` saturates the refcount, so it cannot overflow to zero. Reviewed-by: Martin Rodriguez Reboredo