-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.Category: This is a bug.P-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
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
Metadata
Metadata
Assignees
Labels
A-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.Category: This is a bug.P-criticalCritical priorityCritical priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.