Skip to content

inline_asm missing normalization #189

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

Open
lcnr opened this issue Apr 25, 2025 · 0 comments · May be fixed by rust-lang/rust#140302
Open

inline_asm missing normalization #189

lcnr opened this issue Apr 25, 2025 · 0 comments · May be fixed by rust-lang/rust#140302
Assignees
Labels
from-crater A regression found via a crater run, not part of our test suite

Comments

@lcnr
Copy link
Contributor

lcnr commented Apr 25, 2025

https://crater-reports.s3.amazonaws.com/pr-133502-4/try%230c7fed2b7584d310ca8221267fa1b3bec4df427f/reg/solana-account-decoder-2.1.21/log.txt

fn invoke(pc_section: &[usize]) {
    unsafe {
        std::arch::asm!(
            "/* {} */",
            in(reg) pc_section[0]
        );
    }
}

results in

error: cannot use value of type `<[usize] as Index<usize>>::Output` for inline assembly
 --> src/main.rs:5:21
  |
5 |             in(reg) pc_section[0]
  |                     ^^^^^^^^^^^^^
  |
  = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
@lcnr lcnr added the from-crater A regression found via a crater run, not part of our test suite label Apr 25, 2025
@compiler-errors compiler-errors self-assigned this Apr 25, 2025
@lcnr lcnr moved this from unknown to in progress in -Znext-solver=globally Apr 25, 2025
jhpratt added a commit to jhpratt/rust that referenced this issue Apr 26, 2025
…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 rust-lang/trait-system-refactor-initiative#189, we also add a `try_structurally_resolve_*` call to `expr_ty`.

r? lcnr
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Apr 26, 2025
…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 rust-lang/trait-system-refactor-initiative#189, we also add a `try_structurally_resolve_*` call to `expr_ty`.

r? lcnr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from-crater A regression found via a crater run, not part of our test suite
Projects
Status: in progress
Development

Successfully merging a pull request may close this issue.

2 participants