Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
taiki-e opened this issue Feb 24, 2025 · 1 comment · Fixed by #137548
Closed

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

taiki-e opened this issue Feb 24, 2025 · 1 comment · Fixed by #137548
Assignees
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@taiki-e
Copy link
Member

taiki-e commented Feb 24, 2025

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

@taiki-e taiki-e added C-bug Category: This is a bug. regression-untriaged Untriaged performance or correctness regression. labels Feb 24, 2025
@rustbot rustbot added I-prioritize Issue: Indicates that prioritization has been requested for this issue. needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. A-inline-assembly Area: Inline assembly (`asm!(…)`) regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. and removed regression-untriaged Untriaged performance or correctness regression. labels Feb 24, 2025
@compiler-errors compiler-errors self-assigned this Feb 24, 2025
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 24, 2025
taiki-e added a commit to taiki-e/portable-atomic that referenced this issue Feb 24, 2025
taiki-e added a commit to taiki-e/portable-atomic that referenced this issue Feb 24, 2025
taiki-e added a commit to taiki-e/portable-atomic that referenced this issue Feb 24, 2025
taiki-e added a commit to taiki-e/portable-atomic that referenced this issue Feb 24, 2025
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-critical

@rustbot rustbot added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 24, 2025
@bors bors closed this as completed in 87f3908 Feb 25, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Feb 25, 2025
Rollup merge of rust-lang#137548 - compiler-errors:asm-ty, r=oli-obk

Pass correct `TypingEnv` to `InlineAsmCtxt`

Fixes rust-lang#137512

r? oli-obk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants