diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-08-02 17:17:34 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-02 17:17:34 +0200 |
| commit | 06333e092b9e811646d44b1deffbc3139484b00c (patch) | |
| tree | 77c0a8c1466a864b79d3920e6c24af76352d27f7 /compiler/rustc_builtin_macros | |
| parent | 1ce85b1c392f0029200cb62493a16398fb134799 (diff) | |
| parent | 96c955e66b39f23eca553644aeb2ea5f41ff355a (diff) | |
| download | rust-06333e092b9e811646d44b1deffbc3139484b00c.tar.gz rust-06333e092b9e811646d44b1deffbc3139484b00c.zip | |
Rollup merge of #100045 - Amanieu:global_asm_may_unwind, r=tmiasko
Properly reject the `may_unwind` option in `global_asm!` This was accidentally accepted even though it had no effect in `global_asm!`. The option only makes sense for `asm!` which runs within a function.
Diffstat (limited to 'compiler/rustc_builtin_macros')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/asm.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs index bb64394e21e..1a0ea8f4160 100644 --- a/compiler/rustc_builtin_macros/src/asm.rs +++ b/compiler/rustc_builtin_macros/src/asm.rs @@ -410,12 +410,12 @@ fn parse_options<'a>( try_set_option(p, args, sym::noreturn, ast::InlineAsmOptions::NORETURN); } else if !is_global_asm && p.eat_keyword(sym::nostack) { try_set_option(p, args, sym::nostack, ast::InlineAsmOptions::NOSTACK); + } else if !is_global_asm && p.eat_keyword(sym::may_unwind) { + try_set_option(p, args, kw::Raw, ast::InlineAsmOptions::MAY_UNWIND); } else if p.eat_keyword(sym::att_syntax) { try_set_option(p, args, sym::att_syntax, ast::InlineAsmOptions::ATT_SYNTAX); } else if p.eat_keyword(kw::Raw) { try_set_option(p, args, kw::Raw, ast::InlineAsmOptions::RAW); - } else if p.eat_keyword(sym::may_unwind) { - try_set_option(p, args, kw::Raw, ast::InlineAsmOptions::MAY_UNWIND); } else { return p.unexpected(); } |
