Bug 1942981 - Add explicit ABI marker to extern fn declaration in rust configure test. r=firefox-build-system-reviewers,sergesanspaille

Extern declarations without an explicit ABI are deprecated as of rustc
1.86.

Differential Revision: https://phabricator.services.mozilla.com/D235106
This commit is contained in:
Mike Hommey
2025-01-23 21:16:22 +00:00
parent c57c6be525
commit 497121b08e

View File

@@ -439,7 +439,7 @@ def assert_rust_compile(host_or_target, rustc_target, rustc):
suffix=".rlib" suffix=".rlib"
) as out_path: ) as out_path:
with open(in_path, "w") as fd: with open(in_path, "w") as fd:
source = b'pub extern fn hello() { println!("Hello world"); }' source = b'pub extern "C" fn hello() { println!("Hello world"); }'
log.debug("Creating `%s` with content:", in_path) log.debug("Creating `%s` with content:", in_path)
with LineIO(lambda l: log.debug("| %s", l)) as out: with LineIO(lambda l: log.debug("| %s", l)) as out:
out.write(source) out.write(source)