diff options
| author | Amanieu d'Antras <amanieu@gmail.com> | 2022-08-02 05:25:45 +0100 |
|---|---|---|
| committer | Amanieu d'Antras <amanieu@gmail.com> | 2022-08-02 06:29:32 +0100 |
| commit | 96c955e66b39f23eca553644aeb2ea5f41ff355a (patch) | |
| tree | 50074822bdea34079a41404ca4710f3e2f067e45 /compiler/rustc_builtin_macros/src | |
| parent | 9d5cd21a5d4d5325b1f1c9903d000d19e3703e2a (diff) | |
| download | rust-96c955e66b39f23eca553644aeb2ea5f41ff355a.tar.gz rust-96c955e66b39f23eca553644aeb2ea5f41ff355a.zip | |
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/src')
| -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 a2205c3613d..fc310129b24 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(); } |
