Skip to content

Commit

Permalink
Rollup merge of rust-lang#36118 - nagisa:windows-has-no-sprint-again,…
Browse files Browse the repository at this point in the history
… r=brson

Fix the test_variadic_ptr fn on printf-less sys

Fixes rust-lang#36076
  • Loading branch information
Jonathan Turner authored Aug 31, 2016
2 parents 5dc779b + 987ef78 commit 6e045cc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/libcoretest/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 6e045cc

Please sign in to comment.