Skip to content

Commit e614ed4

Browse files
committed
Restrict #[pin_v2] test on global_asm! to stablized archs only
1 parent ace8345 commit e614ed4

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

tests/ui/pin-ergonomics/pin_v2-attr.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,20 @@ macro_rules! macro_def {
135135
#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on macro calls
136136
macro_def!();
137137

138+
// Restricted on architectures where inline assembly is stable
139+
// accroding to `compiler/rustc_ast_lowering/src/asm.rs`
140+
#[cfg(any(
141+
target_arch = "x86",
142+
target_arch = "x86_64",
143+
target_arch = "arm",
144+
target_arch = "aarch64",
145+
target_arch = "arm64ec",
146+
target_arch = "riscv32",
147+
target_arch = "riscv64",
148+
target_arch = "loongarch32",
149+
target_arch = "loongarch64",
150+
target_arch = "s390x",
151+
))]
138152
std::arch::global_asm! {
139153
"{}",
140154
#[pin_v2] //~ ERROR this attribute is not supported on assembly

tests/ui/pin-ergonomics/pin_v2-attr.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | #[pin_v2]
77
= help: `#[pin_v2]` can be applied to data types and unions
88

99
error: this attribute is not supported on assembly
10-
--> $DIR/pin_v2-attr.rs:140:5
10+
--> $DIR/pin_v2-attr.rs:154:5
1111
|
1212
LL | #[pin_v2]
1313
| ^^^^^^^^^

0 commit comments

Comments
 (0)