diff options
| author | A.J. Gardner <aaron.j.gardner@gmail.com> | 2017-03-15 21:27:40 -0500 |
|---|---|---|
| committer | A.J. Gardner <aaron.j.gardner@gmail.com> | 2017-04-12 19:12:49 -0500 |
| commit | 768e9029413c6fa3857cf8ba7d943bb297a58ee3 (patch) | |
| tree | ff3ec89e044e014c86605a423a2447031d30ade0 /src/libsyntax/ast.rs | |
| parent | 14481f72102ba2abb5f314d5537fee90352981c5 (diff) | |
| download | rust-768e9029413c6fa3857cf8ba7d943bb297a58ee3.tar.gz rust-768e9029413c6fa3857cf8ba7d943bb297a58ee3.zip | |
First attempt at global_asm! macro
Diffstat (limited to 'src/libsyntax/ast.rs')
| -rw-r--r-- | src/libsyntax/ast.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index c6a3e8a2ded..131adfe47af 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1585,6 +1585,15 @@ pub struct ForeignMod { pub items: Vec<ForeignItem>, } +/// Global inline assembly +/// +/// aka module-level assembly or file-scoped assembly +#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)] +pub struct GlobalAsm { + pub asm: Symbol, + pub ctxt: SyntaxContext, +} + #[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)] pub struct EnumDef { pub variants: Vec<Variant>, @@ -1812,6 +1821,8 @@ pub enum ItemKind { /// /// E.g. `extern {}` or `extern "C" {}` ForeignMod(ForeignMod), + /// Module-level inline assembly (from `global_asm!()`) + GlobalAsm(P<GlobalAsm>), /// A type alias (`type` or `pub type`). /// /// E.g. `type Foo = Bar<u8>;` @@ -1864,6 +1875,7 @@ impl ItemKind { ItemKind::Fn(..) => "function", ItemKind::Mod(..) => "module", ItemKind::ForeignMod(..) => "foreign module", + ItemKind::GlobalAsm(..) => "global asm", ItemKind::Ty(..) => "type alias", ItemKind::Enum(..) => "enum", ItemKind::Struct(..) => "struct", |
