Skip to content

Commit d4dca5d

Browse files
committed
rust: doctests: Mark generated rustdoc kunit tests extern "C"
The generated rustdoc tests were marked no_mangle, but not extern "C". Since these are called from C by KUnit, they should use the C ABI. Signed-off-by: David Gow <[email protected]>
1 parent 9c0096c commit d4dca5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/rustdoc_test_gen.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn main() {
3131
rust_tests,
3232
r#"/// Generated `{name}` KUnit test case from a Rust documentation test.
3333
#[no_mangle]
34-
pub fn {name}(__kunit_test: *mut kernel::bindings::kunit) {{
34+
pub extern "C" fn {name}(__kunit_test: *mut kernel::bindings::kunit) {{
3535
/// Provides mutual exclusion (see `# Implementation` notes).
3636
static __KUNIT_TEST_MUTEX: kernel::sync::smutex::Mutex<()> =
3737
kernel::sync::smutex::Mutex::new(());

0 commit comments

Comments
 (0)