Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 3c7c694

Browse files
committed
Document rustc_ast::Extern variants
1 parent b7bc90f commit 3c7c694

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2705,8 +2705,19 @@ impl Item {
27052705
/// `extern` qualifier on a function item or function type.
27062706
#[derive(Clone, Copy, Encodable, Decodable, Debug)]
27072707
pub enum Extern {
2708+
/// No explicit extern keyword was used
2709+
///
2710+
/// E.g. `fn foo() {}`
27082711
None,
2712+
/// An explicit extern keyword was used, but with implicit ABI
2713+
///
2714+
/// E.g. `extern fn foo() {}`
2715+
///
2716+
/// This is just `extern "C"` (see `rustc_target::spec::abi::Abi::FALLBACK`)
27092717
Implicit(Span),
2718+
/// An explicit extern keyword was used with an explicit ABI
2719+
///
2720+
/// E.g. `extern "C" fn foo() {}`
27102721
Explicit(StrLit, Span),
27112722
}
27122723

0 commit comments

Comments
 (0)