summary refs log tree commit diff
path: root/compiler/rustc_builtin_macros/src/asm.rs
diff options
context:
space:
mode:
authorFolkert de Vries <folkert@folkertdev.nl>2024-09-05 19:45:40 +0200
committerFolkert de Vries <folkert@folkertdev.nl>2024-10-06 19:00:09 +0200
commit5fc60d1e52ea12f53d2c8d22fee94592860739ad (patch)
tree084c2db049438541f8365fbb25fe4fa6123c2436 /compiler/rustc_builtin_macros/src/asm.rs
parent10fa482906ab1f2fba07b32b70457ad9444e8f63 (diff)
downloadrust-5fc60d1e52ea12f53d2c8d22fee94592860739ad.tar.gz
rust-5fc60d1e52ea12f53d2c8d22fee94592860739ad.zip
various fixes for `naked_asm!` implementation
- fix for divergence
- fix error message
- fix another cranelift test
- fix some cranelift things
- don't set the NORETURN option for naked asm
- fix use of naked_asm! in doc comment
- fix use of naked_asm! in run-make test
- use `span_bug` in unreachable branch
Diffstat (limited to 'compiler/rustc_builtin_macros/src/asm.rs')
-rw-r--r--compiler/rustc_builtin_macros/src/asm.rs23
1 files changed, 7 insertions, 16 deletions
diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs
index 515ac17f70a..9ae48024f44 100644
--- a/compiler/rustc_builtin_macros/src/asm.rs
+++ b/compiler/rustc_builtin_macros/src/asm.rs
@@ -850,22 +850,13 @@ pub(super) fn expand_naked_asm<'cx>(
                 return ExpandResult::Retry(());
             };
             let expr = match mac {
-                Ok(mut inline_asm) => {
-                    // for future compatibility, we always set the NORETURN option.
-                    //
-                    // When we turn `asm!` into `naked_asm!` with this implementation, we can drop
-                    // the `options(noreturn)`, which makes the upgrade smooth when `naked_asm!`
-                    // starts disallowing the `noreturn` option in the future
-                    inline_asm.options |= ast::InlineAsmOptions::NORETURN;
-
-                    P(ast::Expr {
-                        id: ast::DUMMY_NODE_ID,
-                        kind: ast::ExprKind::InlineAsm(P(inline_asm)),
-                        span: sp,
-                        attrs: ast::AttrVec::new(),
-                        tokens: None,
-                    })
-                }
+                Ok(inline_asm) => P(ast::Expr {
+                    id: ast::DUMMY_NODE_ID,
+                    kind: ast::ExprKind::InlineAsm(P(inline_asm)),
+                    span: sp,
+                    attrs: ast::AttrVec::new(),
+                    tokens: None,
+                }),
                 Err(guar) => DummyResult::raw_expr(sp, Some(guar)),
             };
             MacEager::expr(expr)