diff options
| author | Michael Goulet <michael@errs.io> | 2023-01-02 15:39:19 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-02 15:39:19 -0800 |
| commit | d4cf00f03d35c651b7853935309342a4905943f4 (patch) | |
| tree | dd917108ec0ada980daf1d4d5c283fefde1730b6 | |
| parent | d112cd9a00aa757fd5d285c009a31b918eef3883 (diff) | |
| parent | 157211ff2f0a8f45c6000c46a545412a0fb9eed4 (diff) | |
| download | rust-d4cf00f03d35c651b7853935309342a4905943f4.tar.gz rust-d4cf00f03d35c651b7853935309342a4905943f4.zip | |
Rollup merge of #106383 - Manishearth:ast-docs, r=compiler-errors
Document some of the AST nodes Someone was confused about some of this on Zulip, added some docs We probably should make sure every last field/variant in the AST/HIR is documented at some point `@bors` rollup
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 9cc81f39167..c1b26ca0925 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -2743,8 +2743,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), } @@ -2763,9 +2774,13 @@ impl Extern { /// included in this struct (e.g., `async unsafe fn` or `const extern "C" fn`). #[derive(Clone, Copy, Encodable, Decodable, Debug)] pub struct FnHeader { + /// The `unsafe` keyword, if any pub unsafety: Unsafe, + /// The `async` keyword, if any pub asyncness: Async, + /// The `const` keyword, if any pub constness: Const, + /// The `extern` keyword and corresponding ABI string, if any pub ext: Extern, } |
