about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2023-01-02 14:25:24 -0800
committerManish Goregaokar <manishsmail@gmail.com>2023-01-02 14:42:27 -0800
commit3c7c694e734b6bcc41663eaf230a7f26c19de0f4 (patch)
tree726f3960d49cf25379ed6cc4cf26d1dd48b917fd /compiler
parentb7bc90fea3b441234a84b49fdafeb75815eebbab (diff)
downloadrust-3c7c694e734b6bcc41663eaf230a7f26c19de0f4.tar.gz
rust-3c7c694e734b6bcc41663eaf230a7f26c19de0f4.zip
Document rustc_ast::Extern variants
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_ast/src/ast.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 4ad9981991d..9f38deacca4 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -2705,8 +2705,19 @@ impl Item {
 /// `extern` qualifier on a function item or function type.
 #[derive(Clone, Copy, Encodable, Decodable, Debug)]
 pub enum Extern {
+    /// No explicit extern keyword was used
+    ///
+    /// E.g. `fn foo() {}`
     None,
+    /// An explicit extern keyword was used, but with implicit ABI
+    ///
+    /// E.g. `extern fn foo() {}`
+    ///
+    /// This is just `extern "C"` (see `rustc_target::spec::abi::Abi::FALLBACK`)
     Implicit(Span),
+    /// An explicit extern keyword was used with an explicit ABI
+    ///
+    /// E.g. `extern "C" fn foo() {}`
     Explicit(StrLit, Span),
 }