Skip to content

Commit ed615fb

Browse files
ojedashuahkh
authored andcommitted
rust: types: 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: Martin Rodriguez Reboredo <[email protected]> Reviewed-by: David Gow <[email protected]> Reviewed-by: Björn Roy Baron <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Signed-off-by: Miguel Ojeda <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent bfa7dff commit ed615fb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rust/kernel/types.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl ForeignOwnable for () {
109109
/// In the example below, we have multiple exit paths and we want to log regardless of which one is
110110
/// taken:
111111
/// ```
112-
/// # use kernel::ScopeGuard;
112+
/// # use kernel::types::ScopeGuard;
113113
/// fn example1(arg: bool) {
114114
/// let _log = ScopeGuard::new(|| pr_info!("example1 completed\n"));
115115
///
@@ -127,7 +127,7 @@ impl ForeignOwnable for () {
127127
/// In the example below, we want to log the same message on all early exits but a different one on
128128
/// the main exit path:
129129
/// ```
130-
/// # use kernel::ScopeGuard;
130+
/// # use kernel::types::ScopeGuard;
131131
/// fn example2(arg: bool) {
132132
/// let log = ScopeGuard::new(|| pr_info!("example2 returned early\n"));
133133
///
@@ -148,7 +148,7 @@ impl ForeignOwnable for () {
148148
/// In the example below, we need a mutable object (the vector) to be accessible within the log
149149
/// function, so we wrap it in the [`ScopeGuard`]:
150150
/// ```
151-
/// # use kernel::ScopeGuard;
151+
/// # use kernel::types::ScopeGuard;
152152
/// fn example3(arg: bool) -> Result {
153153
/// let mut vec =
154154
/// ScopeGuard::new_with_data(Vec::new(), |v| pr_info!("vec had {} elements\n", v.len()));

0 commit comments

Comments
 (0)