Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2489349rwd; Fri, 16 Jun 2023 04:33:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ezsr0o3xKKVi7hHz+sM57WDP17Dajkhd2EpzLB3vI9hPgmACd5SAeug3Hw4sIZDSp1YQG X-Received: by 2002:a17:90a:1906:b0:25e:ae0f:7311 with SMTP id 6-20020a17090a190600b0025eae0f7311mr1394516pjg.23.1686915184997; Fri, 16 Jun 2023 04:33:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686915184; cv=none; d=google.com; s=arc-20160816; b=Mb4e7MHD9e0puV1tlR8NIyU3ViRWOwLU+XbeXUaTatTFmjAtHvoZMcNplI3MrAU3VI Oz/g0OiQXtL/x15VMSf3UMhube8HbsvKECKODSfJ4gwdV/4R6QcqxqobUpwaNNQesyK1 NwciLrXgbD28AutKH+G1LxYU2zFbu62qnz8wQRXQJakIvsMV79zIVF2jsQFwJu+XyLN7 NgtrnPUmBv2cby3kdERgZIhu9adOsaXeTG5Wk+JUAAw1DuTPj6tw+3QQq4Y3T+mrJeS3 iXPZveAD8Ck/AOVy32LZg94y3pzDmahNeULouOkDuVFeaOKW1ZsLI5RRE9oXQ72CZstv C07w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=sccioiXsNUAcH9xywdgmZto1VqADKegnl2UO80aJshs=; b=yo4n4bqWgRpCAyafjwyLFJL8Ps8QEw+/OgJFaLoYhwbBSfyk684QBbCD4s9ypzgY0J lyAydMVaAr9o2FiXGTRX6Nn0gTqLjZeA1tWheIc5FZbzS/0WuexTxtJuGM4EbYi3sGGt QvayvVinwPq/xuOYJ7iETiURArdAuUcbjwt0Z+6Hw6J7qt6bccDxhJzSo2y5eBzKi8H5 ZNMvCoaPfj0G09mW+ThXF9iXBywprO2qrT5sVtE3f6KF0q2xnARUtjVwuTGHNzPDVmyS rtYZowDH9EFAmrR68JtkyXdE/NO4ftNztVJ7pQ20X1NaGZMLYdT7f3hirS0+3PznQSJk 3q4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=S+gkd8mb; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j71-20020a63804a000000b00553854417e2si126937pgd.244.2023.06.16.04.32.52; Fri, 16 Jun 2023 04:33:04 -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=@protonmail.com header.s=protonmail3 header.b=S+gkd8mb; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344888AbjFPLNs (ORCPT + 99 others); Fri, 16 Jun 2023 07:13:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344729AbjFPLNr (ORCPT ); Fri, 16 Jun 2023 07:13:47 -0400 Received: from mail-0201.mail-europe.com (mail-0201.mail-europe.com [51.77.79.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3090113E for ; Fri, 16 Jun 2023 04:13:45 -0700 (PDT) Date: Fri, 16 Jun 2023 11:13:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1686914021; x=1687173221; bh=sccioiXsNUAcH9xywdgmZto1VqADKegnl2UO80aJshs=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=S+gkd8mbyeZq1CI9uwKLZz7vUSMHVV/JB7Zd/BELk+ADXaSAYClyM0s3yBO/xiUXY d9eRkDarxVqIUwYqkkAJzmxU0fANLwlE6qWC+E3t3TGlkHfdRXue6HE2m3HCc6Zor0 ivXHZaU59hCvq9R2PjQi01X2m1FmEqIPv8e1fWh3AG7eKwIoaKDk7UuW6dtE/DbCkB 83wFNINzLPfb2hQT/oPCPh0hE6VB1ITbyGA2XRvbbxgHRUKKEyOjjxE9Q4KeZ9M2mY GbqGfYojoyJ0qyTCxn5eWCLv1wJJxM4PHzXAHntBUGvklIFh4yJkgYYOHK27FK7SUY bVYVo03SOU1wA== To: Miguel Ojeda From: =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= Cc: David Gow , Brendan Higgins , Wedson Almeida Filho , Alex Gaynor , Boqun Feng , Gary Guo , 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 Subject: Re: [PATCH 2/6] rust: str: make doctests compilable/testable Message-ID: In-Reply-To: <20230614180837.630180-3-ojeda@kernel.org> References: <20230614180837.630180-1-ojeda@kernel.org> <20230614180837.630180-3-ojeda@kernel.org> Feedback-ID: 27884398:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 ------- Original Message ------- On Wednesday, June 14th, 2023 at 20:08, Miguel Ojeda wro= te: > 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. >=20 > Signed-off-by: Miguel Ojeda > --- > rust/kernel/str.rs | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) >=20 > diff --git a/rust/kernel/str.rs b/rust/kernel/str.rs > index c9dd3bf59e34..c41607b2e4fe 100644 > --- a/rust/kernel/str.rs > +++ b/rust/kernel/str.rs > @@ -213,6 +213,7 @@ impl fmt::Display for CStr { > /// > /// ``` > /// # use kernel::c_str; > + /// # use kernel::fmt; > /// # use kernel::str::CStr; > /// # use kernel::str::CString; > /// let penguin =3D c_str!("=F0=9F=90=A7"); > @@ -241,6 +242,7 @@ impl fmt::Debug for CStr { > /// > /// ``` > /// # use kernel::c_str; > + /// # use kernel::fmt; > /// # use kernel::str::CStr; > /// # use kernel::str::CString; > /// let penguin =3D c_str!("=F0=9F=90=A7"); > @@ -529,7 +531,7 @@ fn write_str(&mut self, s: &str) -> fmt::Result { > /// # Examples > /// > /// ``` > -/// use kernel::str::CString; > +/// use kernel::{str::CString, fmt}; > /// > /// let s =3D CString::try_from_fmt(fmt!("{}{}{}", "abc", 10, 20)).unwra= p(); > /// assert_eq!(s.as_bytes_with_nul(), "abc1020\0".as_bytes()); > --=20 > 2.41.0 Reviewed-by: Bj=C3=B6rn Roy Baron