diff options
| author | Jonathan Turner <jonathandturner@users.noreply.github.com> | 2016-08-31 13:53:35 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-31 13:53:35 -0700 |
| commit | 6e045cc2be09288e2a5033d24312708fd335b8f4 (patch) | |
| tree | cbebb460721789c47246ec267725f6e32eeccf8d /src | |
| parent | 5dc779ba52132b1fc68a9496744722b19eedb02b (diff) | |
| parent | 987ef784fd9cf4e9039f84e3a052e81349108b69 (diff) | |
| download | rust-6e045cc2be09288e2a5033d24312708fd335b8f4.tar.gz rust-6e045cc2be09288e2a5033d24312708fd335b8f4.zip | |
Rollup merge of #36118 - nagisa:windows-has-no-sprint-again, r=brson
Fix the test_variadic_ptr fn on printf-less sys Fixes #36076
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcoretest/ptr.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libcoretest/ptr.rs b/src/libcoretest/ptr.rs index e0a9f4e5d42..f7fe61896f8 100644 --- a/src/libcoretest/ptr.rs +++ b/src/libcoretest/ptr.rs @@ -173,12 +173,16 @@ fn test_unsized_unique() { } #[test] -fn test_variadic_fnptr() { +#[allow(warnings)] +// Have a symbol for the test below. It doesn’t need to be an actual variadic function, match the +// ABI, or even point to an actual executable code, because the function itself is never invoked. +#[no_mangle] +pub fn test_variadic_fnptr() { use core::hash::{Hash, SipHasher}; - extern "C" { - fn printf(_: *const u8, ...); + extern { + fn test_variadic_fnptr(_: u64, ...) -> f64; } - let p: unsafe extern "C" fn(*const u8, ...) = printf; + let p: unsafe extern fn(u64, ...) -> f64 = test_variadic_fnptr; let q = p.clone(); assert_eq!(p, q); assert!(!(p < q)); |
