about summary refs log tree commit diff
path: root/src/test/codegen/debug-linkage-name.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-01-13 13:56:15 +0000
committerbors <bors@rust-lang.org>2021-01-13 13:56:15 +0000
commitfd2df74902fa98bcb71f85fd548c3eb399e6a96a (patch)
treed88a7bde6091f82bd2ae5d492c66088ef705600d /src/test/codegen/debug-linkage-name.rs
parent116d1a7056830ccf649f74f823de4333ed329392 (diff)
parent4614671cae99ff35e61708ab64e9ba7850711750 (diff)
downloadrust-fd2df74902fa98bcb71f85fd548c3eb399e6a96a.tar.gz
rust-fd2df74902fa98bcb71f85fd548c3eb399e6a96a.zip
Auto merge of #76219 - Mark-Simulacrum:extern-require-abi, r=estebank
Add allow-by-default lint on implicit ABI in extern function pointers and items

This adds a new lint, missing_abi, which lints on omitted ABIs on extern blocks, function declarations, and function pointers.

It is currently not emitting the best possible diagnostics -- we need to track the span of "extern" at least or do some heuristic searching based on the available spans -- but seems good enough for an initial pass than can be expanded in future PRs.

This is a pretty large PR, but mostly due to updating a large number of tests to include ABIs; I can split that into a separate PR if it would be helpful, but test updates are already in dedicated commits.
Diffstat (limited to 'src/test/codegen/debug-linkage-name.rs')
-rw-r--r--src/test/codegen/debug-linkage-name.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/test/codegen/debug-linkage-name.rs b/src/test/codegen/debug-linkage-name.rs
index 0d7dca3aba3..9011a7da51d 100644
--- a/src/test/codegen/debug-linkage-name.rs
+++ b/src/test/codegen/debug-linkage-name.rs
@@ -26,17 +26,17 @@ pub mod xyz {
     // CHECK: !DISubprogram(name: "e",
     // CHECK:               linkageName:
     // CHECK-SAME:          line: 29,
-    pub extern fn e() {}
+    pub extern "C" fn e() {}
 
     // CHECK: !DISubprogram(name: "f",
     // CHECK-NOT:           linkageName:
     // CHECK-SAME:          line: 35,
     #[no_mangle]
-    pub extern fn f() {}
+    pub extern "C" fn f() {}
 
     // CHECK: !DISubprogram(name: "g",
     // CHECK-NOT:           linkageName:
     // CHECK-SAME:          line: 41,
     #[export_name = "g"]
-    pub extern fn g() {}
+    pub extern "C" fn g() {}
 }