about summary refs log tree commit diff
path: root/compiler/rustc_ast
diff options
context:
space:
mode:
authorFolkert de Vries <folkert@folkertdev.nl>2025-09-08 19:27:07 +0200
committerFolkert de Vries <folkert@folkertdev.nl>2025-09-09 21:38:38 +0200
commit9196844f0d86242ee3d6a446fe681b6b2d2d674c (patch)
treefdd9e15c5928163e6bc9dc4884d5e76a9341f554 /compiler/rustc_ast
parent0c96200f268df10d4f3ac102f3161c67e5e67221 (diff)
downloadrust-9196844f0d86242ee3d6a446fe681b6b2d2d674c.tar.gz
rust-9196844f0d86242ee3d6a446fe681b6b2d2d674c.zip
c-variadic: reject functions with unsupported extern ABI
Diffstat (limited to 'compiler/rustc_ast')
-rw-r--r--compiler/rustc_ast/src/ast.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 915bae9e5f5..3e8fddd9954 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -2325,6 +2325,11 @@ impl FnSig {
             }
         }
     }
+
+    /// The span of the header's extern, or where to insert it if empty.
+    pub fn extern_span(&self) -> Span {
+        self.header.ext.span().unwrap_or(self.safety_span().shrink_to_hi())
+    }
 }
 
 /// A constraint on an associated item.