Skip to content

Commit

Permalink
Make "C" explicit in extern "C". (#15034)
Browse files Browse the repository at this point in the history
We're making the `missing_abi` lint a warning in rustc, see:
rust-lang/rust#132397
  • Loading branch information
epage authored Jan 8, 2025
2 parents b696870 + a9b50c2 commit d9f65ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/testsuite/build_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,7 @@ fn build_script_with_dynamic_native_dependency() {
crate-type = ["dylib"]
"#,
)
.file("src/lib.rs", "#[no_mangle] pub extern fn foo() {}")
.file("src/lib.rs", r#"#[no_mangle] pub extern "C" fn foo() {}"#)
.build();

let foo = project()
Expand Down Expand Up @@ -2316,7 +2316,7 @@ fn build_script_with_dynamic_native_dependency() {
pub fn bar() {
#[cfg_attr(not(target_env = "msvc"), link(name = "builder"))]
#[cfg_attr(target_env = "msvc", link(name = "builder.dll"))]
extern { fn foo(); }
extern "C" { fn foo(); }
unsafe { foo() }
}
"#,
Expand Down Expand Up @@ -4821,7 +4821,7 @@ fn _rename_with_link_search_path(cross: bool, expected: impl IntoData) {
)
.file(
"src/lib.rs",
"#[no_mangle] pub extern fn cargo_test_foo() {}",
r#"#[no_mangle] pub extern "C" fn cargo_test_foo() {}"#,
);
let p = p.build();

Expand Down Expand Up @@ -4866,7 +4866,7 @@ fn _rename_with_link_search_path(cross: bool, expected: impl IntoData) {
.file(
"src/main.rs",
r#"
extern {
extern "C" {
#[link_name = "cargo_test_foo"]
fn foo();
}
Expand Down

0 comments on commit d9f65ec

Please sign in to comment.