Closed
Description
I tried this code:
unsafe fn _f<T>(p: *mut T) {
core::arch::asm!("/* {} */", in(reg) p);
}
I expected to see this happen: build pass as with nightly-2025-02-23 and older
Instead, this happened:
error: cannot use value of type `*mut T` for inline assembly
--> src/lib.rs:2:42
|
2 | core::arch::asm!("/* {} */", in(reg) p);
| ^
|
= note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
Probably related to #137180. cc @compiler-errors
Meta
rustc --version --verbose
:
rustc 1.87.0-nightly (f8a913b13 2025-02-23)
binary: rustc
commit-hash: f8a913b1381e90379c7ca63ac2b88b9518936628
commit-date: 2025-02-23
host: aarch64-apple-darwin
release: 1.87.0-nightly
LLVM version: 20.1.0
nightly-2025-02-23 (46420c9 2025-02-22) doesn't have this issue.
@rustbot label +regression-from-stable-to-nightly -regression-untriaged +A-inline-assembly