Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: str: make doctests compilable/testable

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.

Reviewed-by: Björn Roy Baron <bjorn3_gh@protonmail.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>
Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
Reviewed-by: David Gow <davidgow@google.com>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>

authored by

Miguel Ojeda and committed by
Shuah Khan
cf36a495 a30e94c2

+3 -1
+3 -1
rust/kernel/str.rs
··· 213 213 /// 214 214 /// ``` 215 215 /// # use kernel::c_str; 216 + /// # use kernel::fmt; 216 217 /// # use kernel::str::CStr; 217 218 /// # use kernel::str::CString; 218 219 /// let penguin = c_str!("🐧"); ··· 242 241 /// 243 242 /// ``` 244 243 /// # use kernel::c_str; 244 + /// # use kernel::fmt; 245 245 /// # use kernel::str::CStr; 246 246 /// # use kernel::str::CString; 247 247 /// let penguin = c_str!("🐧"); ··· 531 529 /// # Examples 532 530 /// 533 531 /// ``` 534 - /// use kernel::str::CString; 532 + /// use kernel::{str::CString, fmt}; 535 533 /// 536 534 /// let s = CString::try_from_fmt(fmt!("{}{}{}", "abc", 10, 20)).unwrap(); 537 535 /// assert_eq!(s.as_bytes_with_nul(), "abc1020\0".as_bytes());