diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2024-09-10 14:42:17 +0200 |
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2024-09-10 15:19:14 +0200 |
| commit | 6ca5ec7b4ef0466a1cdf3fbce9212cabc171d21a (patch) | |
| tree | 75f7f4133a2be928216e01818005068d8daa25f8 /compiler/rustc_ast/src/ast.rs | |
| parent | 26b2b8d162ff6cc399c7e8005230beea7eb12037 (diff) | |
| download | rust-6ca5ec7b4ef0466a1cdf3fbce9212cabc171d21a.tar.gz rust-6ca5ec7b4ef0466a1cdf3fbce9212cabc171d21a.zip | |
disallow `naked_asm!` outside of `#[naked]` functions
Diffstat (limited to 'compiler/rustc_ast/src/ast.rs')
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 85d38a0e28b..42741bdca22 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -2418,11 +2418,22 @@ impl InlineAsmOperand { } } +#[derive(Clone, Copy, Encodable, Decodable, Debug, HashStable_Generic)] +pub enum AsmMacro { + /// The `asm!` macro + Asm, + /// The `global_asm!` macro + GlobalAsm, + /// The `naked_asm!` macro + NakedAsm, +} + /// Inline assembly. /// /// E.g., `asm!("NOP");`. #[derive(Clone, Encodable, Decodable, Debug)] pub struct InlineAsm { + pub asm_macro: AsmMacro, pub template: Vec<InlineAsmTemplatePiece>, pub template_strs: Box<[(Symbol, Option<Symbol>, Span)]>, pub operands: Vec<(InlineAsmOperand, Span)>, |
