Skip to content

Commit a9b50c2

Browse files
committed
Make "C" explicit in extern "C".
1 parent b696870 commit a9b50c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/testsuite/build_script.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2255,7 +2255,7 @@ fn build_script_with_dynamic_native_dependency() {
22552255
crate-type = ["dylib"]
22562256
"#,
22572257
)
2258-
.file("src/lib.rs", "#[no_mangle] pub extern fn foo() {}")
2258+
.file("src/lib.rs", r#"#[no_mangle] pub extern "C" fn foo() {}"#)
22592259
.build();
22602260

22612261
let foo = project()
@@ -2316,7 +2316,7 @@ fn build_script_with_dynamic_native_dependency() {
23162316
pub fn bar() {
23172317
#[cfg_attr(not(target_env = "msvc"), link(name = "builder"))]
23182318
#[cfg_attr(target_env = "msvc", link(name = "builder.dll"))]
2319-
extern { fn foo(); }
2319+
extern "C" { fn foo(); }
23202320
unsafe { foo() }
23212321
}
23222322
"#,
@@ -4821,7 +4821,7 @@ fn _rename_with_link_search_path(cross: bool, expected: impl IntoData) {
48214821
)
48224822
.file(
48234823
"src/lib.rs",
4824-
"#[no_mangle] pub extern fn cargo_test_foo() {}",
4824+
r#"#[no_mangle] pub extern "C" fn cargo_test_foo() {}"#,
48254825
);
48264826
let p = p.build();
48274827

@@ -4866,7 +4866,7 @@ fn _rename_with_link_search_path(cross: bool, expected: impl IntoData) {
48664866
.file(
48674867
"src/main.rs",
48684868
r#"
4869-
extern {
4869+
extern "C" {
48704870
#[link_name = "cargo_test_foo"]
48714871
fn foo();
48724872
}

0 commit comments

Comments
 (0)