lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <swNtKemE4jl-Unjz4p8_YFbTdqelLeksw6BO7uKOoJjltsTg46zSiRGlg2H4eR2PZtlu0mVdR4ZtVkH5ted1u031qaWckxgG4NL5tzx3ymM=@protonmail.com>
Date:   Fri, 16 Jun 2023 11:13:29 +0000
From:   Björn Roy Baron <bjorn3_gh@...tonmail.com>
To:     Miguel Ojeda <ojeda@...nel.org>
Cc:     David Gow <davidgow@...gle.com>,
        Brendan Higgins <brendan.higgins@...ux.dev>,
        Wedson Almeida Filho <wedsonaf@...il.com>,
        Alex Gaynor <alex.gaynor@...il.com>,
        Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
        Benno Lossin <benno.lossin@...ton.me>,
        Alice Ryhl <aliceryhl@...gle.com>,
        Andreas Hindborg <nmi@...aspace.dk>,
        Philip Li <philip.li@...el.com>, kunit-dev@...glegroups.com,
        linux-kselftest@...r.kernel.org, rust-for-linux@...r.kernel.org,
        linux-kernel@...r.kernel.org, patches@...ts.linux.dev
Subject: Re: [PATCH 2/6] rust: str: make doctests compilable/testable


------- Original Message -------
On Wednesday, June 14th, 2023 at 20:08, Miguel Ojeda <ojeda@...nel.org> 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 <ojeda@...nel.org>
> ---
>  rust/kernel/str.rs | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> 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 = c_str!("🐧");
> @@ -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 = c_str!("🐧");
> @@ -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 = CString::try_from_fmt(fmt!("{}{}{}", "abc", 10, 20)).unwrap();
>  /// assert_eq!(s.as_bytes_with_nul(), "abc1020\0".as_bytes());
> -- 
> 2.41.0

Reviewed-by: Björn Roy Baron <bjorn3_gh@...tonmail.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ