diff mbox series

[2/6] rust: str: make doctests compilable/testable

Message ID 20230614180837.630180-3-ojeda@kernel.org (mailing list archive)
State Accepted
Commit cf36a495f07059d23d62640a3f7b6b157da1bfa0
Headers show
Series KUnit integration for Rust doctests | expand

Commit Message

Miguel Ojeda June 14, 2023, 6:08 p.m. UTC
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@kernel.org>
---
 rust/kernel/str.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Alice Ryhl June 14, 2023, 8:32 p.m. UTC | #1
Miguel Ojeda <ojeda@kernel.org> writes:
> 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@kernel.org>

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Martin Rodriguez Reboredo June 15, 2023, 1:04 a.m. UTC | #2
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 <ojeda@kernel.org>
> ---
> [...]

Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Vincenzo Palazzo June 15, 2023, 11:47 p.m. UTC | #3
> 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@kernel.org>
> ---

Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
David Gow June 16, 2023, 4:51 a.m. UTC | #4
On Thu, 15 Jun 2023 at 02:09, Miguel Ojeda <ojeda@kernel.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@kernel.org>
> ---

Reviewed-by: David Gow <davidgow@google.com>

Cheers,
-- David
Björn Roy Baron June 16, 2023, 11:13 a.m. UTC | #5
------- Original Message -------
On Wednesday, June 14th, 2023 at 20:08, Miguel Ojeda <ojeda@kernel.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@kernel.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!("
diff mbox series

Patch

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!("