Skip to content

Commit 579b6f8

Browse files
committed
Bug 1512271 - Allow link.exe to keep linking the stylo tests after rust-lang/rust#54451. r=simonsapin
1 parent d2fbaec commit 579b6f8

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

servo/ports/geckolib/tests/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ fn main() {
8585
for line in r.lines() {
8686
let s = line
8787
.unwrap()
88+
.replace("#[no_mangle]", "")
8889
.replace("pub extern \"C\" fn", "pub unsafe extern \"C\" fn");
8990
w.write_all(s.as_bytes()).unwrap();
9091
w.write_all(b"\n").unwrap();

servo/ports/geckolib/tests/servo_function_signatures.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ mod error_reporter;
1616
#[path = "../../../ports/geckolib/stylesheet_loader.rs"]
1717
mod stylesheet_loader;
1818

19-
#[allow(non_snake_case, unused_unsafe, private_no_mangle_fns)]
19+
#[allow(non_snake_case, unused_unsafe)]
2020
mod glue {
21-
// this module pretends to be glue.rs, with the safe functions swapped for unsafe ones. This is
22-
// a hack to compensate for the fact that `fn` types cannot coerce to `unsafe fn` types. The
23-
// imports are populated with the same things so the type assertion should be equivalent
21+
// this module pretends to be glue.rs, with the safe functions swapped for
22+
// unsafe ones. This is a hack to compensate for the fact that `fn` types
23+
// cannot coerce to `unsafe fn` types. The imports are populated with the
24+
// same things so the type assertion should be equivalent.
25+
//
26+
// We also rely on #[no_mangle] being stripped out so that it can link on
27+
// Windows without linking to Gecko, see bug 1512271.
2428
use geckoservo::*;
2529
include!(concat!(env!("OUT_DIR"), "/glue.rs"));
2630
}

0 commit comments

Comments
 (0)