Skip to content

Commit 5ea1a17

Browse files
authored
Rollup merge of #128570 - folkertdev:stabilize-asm-const, r=Amanieu
Stabilize `asm_const` tracking issue: rust-lang/rust#93332 reference PR: rust-lang/reference#1556 this will probably require some CI wrangling (and a rebase), so let's get that over with even though the final required PR is not merged yet. r? `@ghost`
2 parents 1bdeb98 + bf5d862 commit 5ea1a17

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

tests/run/asm.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
// Run-time:
44
// status: 0
55

6-
#![feature(asm_const)]
7-
8-
#[cfg(target_arch="x86_64")]
6+
#[cfg(target_arch = "x86_64")]
97
use std::arch::{asm, global_asm};
108

11-
#[cfg(target_arch="x86_64")]
9+
#[cfg(target_arch = "x86_64")]
1210
global_asm!(
1311
"
1412
.global add_asm
@@ -22,7 +20,7 @@ extern "C" {
2220
fn add_asm(a: i64, b: i64) -> i64;
2321
}
2422

25-
#[cfg(target_arch="x86_64")]
23+
#[cfg(target_arch = "x86_64")]
2624
pub unsafe fn mem_cpy(dst: *mut u8, src: *const u8, len: usize) {
2725
asm!(
2826
"rep movsb",
@@ -33,7 +31,7 @@ pub unsafe fn mem_cpy(dst: *mut u8, src: *const u8, len: usize) {
3331
);
3432
}
3533

36-
#[cfg(target_arch="x86_64")]
34+
#[cfg(target_arch = "x86_64")]
3735
fn asm() {
3836
unsafe {
3937
asm!("nop");
@@ -178,9 +176,8 @@ fn asm() {
178176
assert_eq!(array1, array2);
179177
}
180178

181-
#[cfg(not(target_arch="x86_64"))]
182-
fn asm() {
183-
}
179+
#[cfg(not(target_arch = "x86_64"))]
180+
fn asm() {}
184181

185182
fn main() {
186183
asm();

0 commit comments

Comments
 (0)