From 8acdef75e7a585a01b5df6fffa4280211275bef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 11 Dec 2018 15:31:17 +0100 Subject: [PATCH] Bug 1512271 - Allow link.exe to keep linking the stylo tests after rust-lang/rust#54451. r=simonsapin --- servo/ports/geckolib/tests/build.rs | 1 + .../geckolib/tests/servo_function_signatures.rs | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/servo/ports/geckolib/tests/build.rs b/servo/ports/geckolib/tests/build.rs index 7dc08ed8f9aa..ea845db30281 100644 --- a/servo/ports/geckolib/tests/build.rs +++ b/servo/ports/geckolib/tests/build.rs @@ -85,6 +85,7 @@ fn main() { for line in r.lines() { let s = line .unwrap() + .replace("#[no_mangle]", "") .replace("pub extern \"C\" fn", "pub unsafe extern \"C\" fn"); w.write_all(s.as_bytes()).unwrap(); w.write_all(b"\n").unwrap(); diff --git a/servo/ports/geckolib/tests/servo_function_signatures.rs b/servo/ports/geckolib/tests/servo_function_signatures.rs index 8336b61acccc..8ae03d4c4000 100644 --- a/servo/ports/geckolib/tests/servo_function_signatures.rs +++ b/servo/ports/geckolib/tests/servo_function_signatures.rs @@ -16,11 +16,15 @@ mod error_reporter; #[path = "../../../ports/geckolib/stylesheet_loader.rs"] mod stylesheet_loader; -#[allow(non_snake_case, unused_unsafe, private_no_mangle_fns)] +#[allow(non_snake_case, unused_unsafe)] mod glue { - // this module pretends to be glue.rs, with the safe functions swapped for unsafe ones. This is - // a hack to compensate for the fact that `fn` types cannot coerce to `unsafe fn` types. The - // imports are populated with the same things so the type assertion should be equivalent + // this module pretends to be glue.rs, with the safe functions swapped for + // unsafe ones. This is a hack to compensate for the fact that `fn` types + // cannot coerce to `unsafe fn` types. The imports are populated with the + // same things so the type assertion should be equivalent. + // + // We also rely on #[no_mangle] being stripped out so that it can link on + // Windows without linking to Gecko, see bug 1512271. use geckoservo::*; include!(concat!(env!("OUT_DIR"), "/glue.rs")); }