Skip to content

Regression: nightly-2025-02-24 rejects raw pointer in asm! #137512

Closed
@taiki-e

Description

@taiki-e

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

Labels

A-inline-assemblyArea: Inline assembly (`asm!(…)`)C-bugCategory: This is a bug.P-criticalCritical priorityT-compilerRelevant 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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions