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

Allow MaybeUninit in input and output of inline assembly #1481

Merged
merged 1 commit into from
Apr 14, 2024

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Apr 14, 2024

Fixes #1428

MaybeUninit registers have been supported since rust-lang/rust#114790.
This PR uses the same way as that used in that PR.

Tested on a crate with heavy use of MaybeUninit registers (https://github.com/taiki-e/atomic-maybe-uninit).

$ git clone https://github.com/taiki-e/atomic-maybe-uninit
$ cd atomic-maybe-uninit

# With `-Z codegen-backend=cranelift`
$ RUSTFLAGS='-Z codegen-backend=cranelift' ./tools/test.sh --tests 
+ RUSTFLAGS='-Z codegen-backend=cranelift -C panic=abort -Z panic_abort_tests' \
+ RUSTDOCFLAGS=' -C panic=abort -Z panic_abort_tests' \
+ cargo test --tests --all-features --workspace
   Compiling atomic-maybe-uninit v0.3.1 (/Users/taiki/projects/sources/taiki-e/atomic-maybe-uninit)
thread 'rustc' panicked at src/inline_asm.rs:790:45:
called `Option::unwrap()` on a `None` value

# With this PR
$ cargo=path/to/dist/cargo-clif ./tools/test.sh --tests
+ RUSTFLAGS=' -C panic=abort -Z panic_abort_tests' \
+ RUSTDOCFLAGS=' -C panic=abort -Z panic_abort_tests' \
+ path/to/dist/cargo-clif test --tests --all-features --workspace
   Compiling atomic-maybe-uninit v0.3.1 (/Users/taiki/projects/sources/taiki-e/atomic-maybe-uninit)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.03s
     Running unittests src/lib.rs (target/debug/deps/atomic_maybe_uninit-299d38e254d4f4b0)

running 192 tests
<omitted>
test result: ok. 192 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.39s

@bjorn3 bjorn3 merged commit 49ad3ae into rust-lang:master Apr 14, 2024
18 checks passed
@bjorn3
Copy link
Member

bjorn3 commented Apr 14, 2024

Thanks!

@taiki-e taiki-e deleted the asm-maybe-uninit branch April 14, 2024 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ice: None, asm
2 participants