Skip to content

Commit 1c4c90d

Browse files
Undinyopox
authored andcommitted
T: add necessary import for asm macro
`asm` macro was removed from stdlib prelude in 1.59 See rust-lang/rust#91728
1 parent 21dd23f commit 1c4c90d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/test/kotlin/org/rust/ide/annotator/RsUnsafeExpressionErrorAnnotatorTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,15 @@ class RsUnsafeExpressionErrorAnnotatorTest : RsAnnotatorTestBase(RsUnsafeExpress
138138

139139
@ProjectDescriptor(WithStdlibRustProjectDescriptor::class)
140140
fun `test need unsafe asm macro call`() = checkErrors("""
141+
use std::arch::asm; // required since 1.59
141142
fn main() {
142143
<error descr="use of `asm!()` is unsafe and requires unsafe function or block [E0133]">asm!("nop")</error>;
143144
}
144145
""")
145146

146147
@ProjectDescriptor(WithStdlibRustProjectDescriptor::class)
147148
fun `test need unsafe asm macro expr`() = checkErrors("""
149+
use std::arch::asm; // required since 1.59
148150
fn main() {
149151
<error descr="use of `asm!()` is unsafe and requires unsafe function or block [E0133]">asm!("nop")</error>
150152
}

src/test/kotlin/org/rust/lang/core/resolve/RsStdlibResolveTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,8 @@ class RsStdlibResolveTest : RsResolveTestBase() {
279279
fun `test asm macro`() = stubOnlyResolve("""
280280
//- main.rs
281281
#![feature(asm)]
282+
283+
use std::arch::asm; // required since 1.59
282284
fn main() {
283285
asm!("nop");
284286
} //^ ...libcore/macros/mod.rs|...core/src/macros/mod.rs|...core/src/lib.rs

0 commit comments

Comments
 (0)