Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp532947rwd; Wed, 14 Jun 2023 21:06:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4d6qxfW1J857L0Kf55P8vcBlQ08FEsPV+lgRxhHmM6/cjLCNKuaFBZkNvvpv3N765Xi0sr X-Received: by 2002:a17:907:7e97:b0:981:82c0:15bb with SMTP id qb23-20020a1709077e9700b0098182c015bbmr10650299ejc.0.1686801967293; Wed, 14 Jun 2023 21:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686801967; cv=none; d=google.com; s=arc-20160816; b=FD/ZYpAEOhvqJMwAeXIYw6gkrvoDwtvBi/da8Uxc7ME2lX14R3jjxedMreNF4HGNvd oGlqVEbAO6CFdxCKNRkIlQ/ujPqiNXUBaXktN5DPBcuphYop1/t7o/eJKyNAxKIkItJ9 2CCNLoNJwCYdS8qmAvEbor1dN+5N8GYEaxbwmW3cQFk8wibvWq/qshZytBxZ1JmptAtn TVBpT7o5XRRIx3Z9nVFE8zTo1tjt2k4NAdf4eKFaZvT6cQo5fVDq/PCcuNRdJRSD2AKn 7e+DZWnRdITO3cd4Ut1uCygsxgNAx0EG96FBtTWa6CPwOGNgjLSBEb+ZpSaD9Ca9oDT5 AdpA== 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=XvOg6IfbDqELoJ+xhmzfRwP+bYiifV5+pLJQKyD2w2k=; b=0U6k3wAj0wrOJ/NOgLOVhIb/MyZveEIx8J1r+DNLEOe6vJqEmMFGH+JOJW8wd7z21o Z55iXFDHH64KCAn9An5Gk6mFnSi9azPyG0zM1CSveHjuSiZtc2x1rKqrNi08JiOhi2QQ 8SYQsaqFr3hsLKpmJuZ1AUrmELIOCmqKXHdiDUK7MTTVuhXlmS2bikt7MoZ5kHNObqCm 6p39IfERHISwdDkjl2aINgWxDIsnB79neU9s8t35CT47e99tFCovG2x/lGeigJwruqOl vf7t786t8GMyGR5KUj7yHB8hiuWx3CzBw2Y9+EDYD3A7jzyLHtilcodwqNrmp3SwxZPT 2Jrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="mc/lDSJl"; 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 o10-20020a1709061d4a00b00977d0f093b5si9357624ejh.556.2023.06.14.21.05.42; Wed, 14 Jun 2023 21:06:07 -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="mc/lDSJl"; 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 S238287AbjFODwV (ORCPT + 99 others); Wed, 14 Jun 2023 23:52:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238184AbjFODwK (ORCPT ); Wed, 14 Jun 2023 23:52:10 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64F0B26B6; Wed, 14 Jun 2023 20:52:06 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-6b2afc1ec49so277226a34.0; Wed, 14 Jun 2023 20:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686801125; x=1689393125; 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=XvOg6IfbDqELoJ+xhmzfRwP+bYiifV5+pLJQKyD2w2k=; b=mc/lDSJlyiOvuCU0/kkMoWp3+Qa3gQ1ViKUT8uc95AOn+AXSA5VSlE9WJ1HQsI7IRr KsmRtH32ZHgQ4Hlv1g/oF8L2iDIIx7orxQ5HMr3hX7c/wVvv3Zb3KLCqtLi/xaYUs1Jc h5iBQaoFu/IzLJ8Xyuu7R16T4cTqd4AapakxQRGDTODajej2QnBCVWmUigc+nMjqpqL5 nwj/W2K5CfTbZd+1mQUX42cy4tjkMzMnBj6Cc1eUPQM1hxf6QaKXCHH3b7yEUPBFf1gl 3kLL4Si6UgrroKc/LniXIXnP9lNLVwR4AMPQf+W2WQ9GcKfzDJzxy60Z8VNK9EctvHwd 6RtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686801125; x=1689393125; 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=XvOg6IfbDqELoJ+xhmzfRwP+bYiifV5+pLJQKyD2w2k=; b=f7zqEWt64ExCeHTzMrjG2ikhkRDLCnZPp1I0h3K1UktbbhUBQ/A2NPhnFUlQFbf+01 zJkerYjngltq01yK3vz+wClzhi78CKsTOGxIZkLCyuw2jb5XEPptXxozjb/hBfIjuJ8J aT9Dd+tZi/2J6Ry5znaBOhiwG1/Hzr7qOKqIpwpRAyO0BGjT0M50e1VeLNpffVTu0uYI NOdEin3z5pHKOokHAzYZ6tCfwSBHjLcK0ziI+EccVkhwawPPHl/DjhEw/pNi2rBnAmGr PAA/xedwhDwe1y4a0kpWYyjjUzclB+36iKirZShQ/C4S9CUAPrdPKRnmAgWuvqVQKArB +3ZA== X-Gm-Message-State: AC+VfDxe6APS9kCVkdyJNBmysoohtwthIG5saTDpEvu63/8YFBD8qbpG y2A7d//6AmNjEIcbi3+J9SY= X-Received: by 2002:a05:6830:6112:b0:6b4:293e:b99a with SMTP id ca18-20020a056830611200b006b4293eb99amr2953804otb.9.1686801125584; Wed, 14 Jun 2023 20:52:05 -0700 (PDT) Received: from [192.168.54.90] (static.220.238.itcsa.net. [190.15.220.238]) by smtp.gmail.com with ESMTPSA id c8-20020a9d4808000000b006b296562566sm6338554otf.79.2023.06.14.20.52.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jun 2023 20:52:05 -0700 (PDT) Message-ID: <2b4b23ce-316e-b998-7faf-e529b121a8b4@gmail.com> Date: Wed, 14 Jun 2023 22:03:33 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 1/6] rust: init: make doctests compilable/testable Content-Language: en-US To: Miguel Ojeda , David Gow , Brendan Higgins , Wedson Almeida Filho , Alex Gaynor Cc: Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=c3=b6rn_Roy_Baron?= , Benno Lossin , Alice Ryhl , Andreas Hindborg , Philip Li , kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev References: <20230614180837.630180-1-ojeda@kernel.org> <20230614180837.630180-2-ojeda@kernel.org> From: Martin Rodriguez Reboredo In-Reply-To: <20230614180837.630180-2-ojeda@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 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 6/14/23 15:08, Miguel Ojeda wrote: > Rust documentation tests are going to be build/run-tested > with the KUnit integration added in a future patch, thus > update them to make them compilable/testable so that we > may start enforcing it. > > Signed-off-by: Miguel Ojeda > --- > [...] > //! # pub unsafe fn destroy_foo(_ptr: *mut foo) {} > //! # pub unsafe fn enable_foo(_ptr: *mut foo, _flags: u32) -> i32 { 0 } > //! # } > +//! # trait FromErrno { > +//! # fn from_errno(errno: core::ffi::c_int) -> Error { > +//! # // Dummy error that can be constructed outside the `kernel` crate. > +//! # Error::from(core::fmt::Error) > +//! # } > +//! # } > +//! # impl FromErrno for Error {} > //! /// # Invariants > //! /// > //! /// `foo` is always initialized > [...] Little question, what's the purpose of `FromErrno` here?