Skip to content

Commit 6e7d206

Browse files
authored
Rollup merge of #103168 - Amanieu:stable_asm_sym, r=davidtwco
Stabilize asm_sym Tracking issue #93333 Reference PR: rust-lang/reference#1270
2 parents b411b88 + 430bd62 commit 6e7d206

39 files changed

+61
-114
lines changed

compiler/rustc_ast_lowering/src/asm.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
192192
}
193193
}
194194
InlineAsmOperand::Sym { ref sym } => {
195-
if !self.tcx.features().asm_sym {
196-
feature_err(
197-
&sess.parse_sess,
198-
sym::asm_sym,
199-
*op_sp,
200-
"sym operands for inline assembly are unstable",
201-
)
202-
.emit();
203-
}
204-
205195
let static_def_id = self
206196
.resolver
207197
.get_partial_res(sym.id)

compiler/rustc_codegen_gcc/tests/run/asm.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
// Run-time:
44
// status: 0
55

6-
#![feature(asm_const, asm_sym)]
6+
#![feature(asm_const)]
77

88
use std::arch::{asm, global_asm};
99

10-
global_asm!("
10+
global_asm!(
11+
"
1112
.global add_asm
1213
add_asm:
1314
mov rax, rdi
@@ -132,7 +133,9 @@ fn main() {
132133
assert_eq!(x, 43);
133134

134135
// check sym fn
135-
extern "C" fn foo() -> u64 { 42 }
136+
extern "C" fn foo() -> u64 {
137+
42
138+
}
136139
let x: u64;
137140
unsafe {
138141
asm!("call {}", sym foo, lateout("rax") x);

compiler/rustc_feature/src/accepted.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ declare_features! (
5353
(accepted, abi_sysv64, "1.24.0", Some(36167), None),
5454
/// Allows using ADX intrinsics from `core::arch::{x86, x86_64}`.
5555
(accepted, adx_target_feature, "1.61.0", Some(44839), None),
56+
/// Allows using `sym` operands in inline assembly.
57+
(accepted, asm_sym, "CURRENT_RUSTC_VERSION", Some(93333), None),
5658
/// Allows the definition of associated constants in `trait` or `impl` blocks.
5759
(accepted, associated_consts, "1.20.0", Some(29646), None),
5860
/// Allows using associated `type`s in `trait`s.

compiler/rustc_feature/src/active.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,6 @@ declare_features! (
300300
(active, asm_const, "1.58.0", Some(93332), None),
301301
/// Enables experimental inline assembly support for additional architectures.
302302
(active, asm_experimental_arch, "1.58.0", Some(93335), None),
303-
/// Allows using `sym` operands in inline assembly.
304-
(active, asm_sym, "1.58.0", Some(93333), None),
305303
/// Allows the `may_unwind` option in inline assembly.
306304
(active, asm_unwind, "1.58.0", Some(93334), None),
307305
/// Allows users to enforce equality of associated constants `TraitImpl<AssocConst=3>`.

src/doc/unstable-book/src/language-features/asm-sym.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/test/assembly/asm/aarch64-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// compile-flags: --target aarch64-unknown-linux-gnu
33
// needs-llvm-components: aarch64
44

5-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym)]
5+
#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
66
#![crate_type = "rlib"]
77
#![no_core]
88
#![allow(asm_sub_register, non_camel_case_types)]

src/test/assembly/asm/arm-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// compile-flags: -C target-feature=+neon
44
// needs-llvm-components: arm
55

6-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym)]
6+
#![feature(no_core, lang_items, rustc_attrs, repr_simd)]
77
#![crate_type = "rlib"]
88
#![no_core]
99
#![allow(asm_sub_register, non_camel_case_types)]

src/test/assembly/asm/avr-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// compile-flags: --target avr-unknown-gnu-atmega328
33
// needs-llvm-components: avr
44

5-
#![feature(no_core, lang_items, rustc_attrs, asm_sym, asm_experimental_arch)]
5+
#![feature(no_core, lang_items, rustc_attrs, asm_experimental_arch)]
66
#![crate_type = "rlib"]
77
#![no_core]
88
#![allow(non_camel_case_types)]

src/test/assembly/asm/bpf-types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// compile-flags: --target bpfel-unknown-none -C target_feature=+alu32
33
// needs-llvm-components: bpf
44

5-
#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_sym, asm_experimental_arch)]
5+
#![feature(no_core, lang_items, rustc_attrs, repr_simd, asm_experimental_arch)]
66
#![crate_type = "rlib"]
77
#![no_core]
88
#![allow(asm_sub_register, non_camel_case_types)]

src/test/assembly/asm/global_asm.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// compile-flags: -C llvm-args=--x86-asm-syntax=intel
55
// compile-flags: -C symbol-mangling-version=v0
66

7-
#![feature(asm_const, asm_sym)]
7+
#![feature(asm_const)]
88
#![crate_type = "rlib"]
99

1010
use std::arch::global_asm;
@@ -28,4 +28,6 @@ global_asm!("lea rax, [rip + {}]", sym MY_STATIC);
2828
// CHECK: call _RNvCsiubXh4Yz005_10global_asm6foobar
2929
global_asm!("call {}", sym foobar);
3030
// CHECK: _RNvCsiubXh4Yz005_10global_asm6foobar:
31-
fn foobar() { loop {} }
31+
fn foobar() {
32+
loop {}
33+
}

0 commit comments

Comments
 (0)