We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eaf71f8 commit 987ef78Copy full SHA for 987ef78
src/libcoretest/ptr.rs
@@ -173,12 +173,16 @@ fn test_unsized_unique() {
173
}
174
175
#[test]
176
-fn test_variadic_fnptr() {
+#[allow(warnings)]
177
+// Have a symbol for the test below. It doesn’t need to be an actual variadic function, match the
178
+// ABI, or even point to an actual executable code, because the function itself is never invoked.
179
+#[no_mangle]
180
+pub fn test_variadic_fnptr() {
181
use core::hash::{Hash, SipHasher};
- extern "C" {
- fn printf(_: *const u8, ...);
182
+ extern {
183
+ fn test_variadic_fnptr(_: u64, ...) -> f64;
184
- let p: unsafe extern "C" fn(*const u8, ...) = printf;
185
+ let p: unsafe extern fn(u64, ...) -> f64 = test_variadic_fnptr;
186
let q = p.clone();
187
assert_eq!(p, q);
188
assert!(!(p < q));
0 commit comments