Skip to content

Commit a5e5c0d

Browse files
committed
fix(ctest): cast fn pointers as *const ()
1 parent 7b336ae commit a5e5c0d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

ctest/templates/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ mod generated_tests {
341341
fn ctest_foreign_fn__{{ item.id }}() -> unsafe extern "C" fn();
342342
}
343343
let actual = unsafe { ctest_foreign_fn__{{ item.id }}() } as u64;
344-
let expected = {{ item.id }} as u64;
344+
let expected = {{ item.id }} as *const () as u64;
345345
check_same(actual, expected, "`{{ item.id }}` function pointer");
346346
}
347347
{%- endfor +%}

ctest/tests/input/hierarchy.out.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ mod generated_tests {
238238
fn ctest_foreign_fn__malloc() -> unsafe extern "C" fn();
239239
}
240240
let actual = unsafe { ctest_foreign_fn__malloc() } as u64;
241-
let expected = malloc as u64;
241+
let expected = malloc as *const () as u64;
242242
check_same(actual, expected, "`malloc` function pointer");
243243
}
244244

ctest/tests/input/simple.out.with-renames.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ mod generated_tests {
11791179
fn ctest_foreign_fn__calloc() -> unsafe extern "C" fn();
11801180
}
11811181
let actual = unsafe { ctest_foreign_fn__calloc() } as u64;
1182-
let expected = calloc as u64;
1182+
let expected = calloc as *const () as u64;
11831183
check_same(actual, expected, "`calloc` function pointer");
11841184
}
11851185

0 commit comments

Comments
 (0)