about summary refs log tree commit diff
path: root/tests/ui/asm
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2025-04-28 23:29:16 +0000
committerGitHub <noreply@github.com>2025-04-28 23:29:16 +0000
commit3f5406f5be15dcb0c6fdee53c9f94fdf280d54dd (patch)
tree8b9fea0816ede25384eef630d1a9fffc08e857e6 /tests/ui/asm
parent0bd531aaf2622553a1488ede23db32aa51040f6c (diff)
parent3ab6051b95130bf5e8363a04bae4b9b5c64a8678 (diff)
downloadrust-3f5406f5be15dcb0c6fdee53c9f94fdf280d54dd.tar.gz
rust-3f5406f5be15dcb0c6fdee53c9f94fdf280d54dd.zip
Rollup merge of #140302 - compiler-errors:inline_asm-bug, r=lcnr
Move inline asm check to typeck, properly handle aliases

Pull `InlineAsmCtxt` down to `rustc_hir_typeck`, and instead of using things like `Ty::is_copy`, use the `InferCtxt`-aware methods. To fix https://github.com/rust-lang/trait-system-refactor-initiative/issues/189, we also add a `try_structurally_resolve_*` call to `expr_ty`.

r? lcnr
Diffstat (limited to 'tests/ui/asm')
-rw-r--r--tests/ui/asm/named_const_simd_vec_len.rs3
-rw-r--r--tests/ui/asm/normalizable-asm-ty.rs16
2 files changed, 19 insertions, 0 deletions
diff --git a/tests/ui/asm/named_const_simd_vec_len.rs b/tests/ui/asm/named_const_simd_vec_len.rs
index 7df4d922d5c..7fedeb7d4d1 100644
--- a/tests/ui/asm/named_const_simd_vec_len.rs
+++ b/tests/ui/asm/named_const_simd_vec_len.rs
@@ -3,6 +3,9 @@
 
 //@ only-x86_64
 //@ check-pass
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
 
 #![feature(repr_simd)]
 
diff --git a/tests/ui/asm/normalizable-asm-ty.rs b/tests/ui/asm/normalizable-asm-ty.rs
new file mode 100644
index 00000000000..c1f3f3ecd61
--- /dev/null
+++ b/tests/ui/asm/normalizable-asm-ty.rs
@@ -0,0 +1,16 @@
+//@ check-pass
+//@ needs-asm-support
+//@ revisions: current next
+//@ ignore-compare-mode-next-solver (explicit revisions)
+//@[next] compile-flags: -Znext-solver
+
+fn invoke(pc_section: &[usize]) {
+    unsafe {
+        std::arch::asm!(
+            "/* {} */",
+            in(reg) pc_section[0]
+        );
+    }
+}
+
+fn main() {}