File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -173,12 +173,16 @@ fn test_unsized_unique() {
173173}
174174
175175#[ test]
176- fn test_variadic_fnptr ( ) {
176+ #[ 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 ( ) {
177181 use core:: hash:: { Hash , SipHasher } ;
178- extern "C" {
179- fn printf ( _: * const u8 , ...) ;
182+ extern {
183+ fn test_variadic_fnptr ( _: u64 , ...) -> f64 ;
180184 }
181- let p: unsafe extern "C" fn ( * const u8 , ...) = printf ;
185+ let p: unsafe extern fn ( u64 , ...) -> f64 = test_variadic_fnptr ;
182186 let q = p. clone ( ) ;
183187 assert_eq ! ( p, q) ;
184188 assert ! ( !( p < q) ) ;
You can’t perform that action at this time.
0 commit comments