Simplify how inline asm handles MaybeUninit by WaffleLapkin · Pull Request #149950 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation8 Commits1 Checks11 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
This is just better, but this is also allows it to handle changes from #149614 (i.e. ManuallyDrop containing MaybeDangle).
rustbot added S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
and removed S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
labels
rustbot has assigned @jdonszelmann.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
Could you also update the same code in rustc_codegen_cranelift?
| // Adapted from https://github.com/rust-lang/rust/blob/f3c66088610c1b80110297c2d9a8b5f9265b013f/compiler/rustc\_hir\_analysis/src/check/intrinsicck.rs#L136-L151 |
|---|
| ty::Adt(adt, args) if fx.tcx.is_lang_item(adt.did(), LangItem::MaybeUninit) => { |
| let fields = &adt.non_enum_variant().fields; |
| let ty = fields[FieldIdx::ONE].ty(fx.tcx, args); |
| let ty::Adt(ty, args) = ty.kind() else { |
| unreachable!("expected first field of `MaybeUninit` to be an ADT") |
| }; |
| assert!( |
| ty.is_manually_drop(), |
| "expected first field of `MaybeUninit` to be `ManuallyDrop`" |
| ); |
| let fields = &ty.non_enum_variant().fields; |
| let ty = fields[FieldIdx::ZERO].ty(fx.tcx, args); |
Some changes occurred in compiler/rustc_codegen_cranelift
cc @bjorn3
@taiki-e good catch, I've updated it too.
📌 Commit cfb6a1f has been approved by jdonszelmann
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…m, r=jdonszelmann
Simplify how inline asm handles MaybeUninit
This is just better, but this is also allows it to handle changes from rust-lang#149614 (i.e. ManuallyDrop containing MaybeDangle).
bors added a commit that referenced this pull request
Rollup of 9 pull requests
Successful merges:
- #148756 (Warn on codegen attributes on required trait methods)
- #148790 (Add new Tier-3 target: riscv64im-unknown-none-elf)
- #149271 (feat: dlopen Enzyme)
- #149354 (Bootstrap config: libgccjit libs dir)
- #149459 (std: sys: fs: uefi: Implement set_times and set_perm)
- #149950 (Simplify how inline asm handles
MaybeUninit) - #150000 (Port
#[rustc_legacy_const_generics]to use attribute parser ) - #150014 (Metadata loader cleanups)
- #150021 (document that mpmc channels deliver an item to (at most) one receiver)
r? @ghost
@rustbot modify labels: rollup
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
…m, r=jdonszelmann
Simplify how inline asm handles MaybeUninit
This is just better, but this is also allows it to handle changes from rust-lang#149614 (i.e. ManuallyDrop containing MaybeDangle).
bors added a commit that referenced this pull request
Rollup of 8 pull requests
Successful merges:
- #148756 (Warn on codegen attributes on required trait methods)
- #148790 (Add new Tier-3 target: riscv64im-unknown-none-elf)
- #149271 (feat: dlopen Enzyme)
- #149459 (std: sys: fs: uefi: Implement set_times and set_perm)
- #149950 (Simplify how inline asm handles
MaybeUninit) - #150000 (Port
#[rustc_legacy_const_generics]to use attribute parser ) - #150014 (Metadata loader cleanups)
- #150021 (document that mpmc channels deliver an item to (at most) one receiver)
r? @ghost
@rustbot modify labels: rollup
Zalathar added a commit to Zalathar/rust that referenced this pull request
…m, r=jdonszelmann
Simplify how inline asm handles MaybeUninit
This is just better, but this is also allows it to handle changes from rust-lang#149614 (i.e. ManuallyDrop containing MaybeDangle).
bors added a commit that referenced this pull request
Rollup of 14 pull requests
Successful merges:
- #148756 (Warn on codegen attributes on required trait methods)
- #148790 (Add new Tier-3 target: riscv64im-unknown-none-elf)
- #149271 (feat: dlopen Enzyme)
- #149459 (std: sys: fs: uefi: Implement set_times and set_perm)
- #149771 (bootstrap readme: make easy to read when editor wrapping is not enabled)
- #149856 (Provide an extended framework for type visit, for use in rust-analyzer)
- #149950 (Simplify how inline asm handles
MaybeUninit) - #150014 (Metadata loader cleanups)
- #150021 (document that mpmc channels deliver an item to (at most) one receiver)
- #150022 (Generate macro expansion for rust compiler crates docs)
- #150029 (Update books)
- #150031 (assert impossible branch is impossible)
- #150034 (do not add
I-prioritizewhenF-*labels are present) - #150036 (Use the embeddable filename for coverage artifacts)
r? @ghost
@rustbot modify labels: rollup
bors added a commit that referenced this pull request
Rollup of 13 pull requests
Successful merges:
- #148756 (Warn on codegen attributes on required trait methods)
- #148790 (Add new Tier-3 target: riscv64im-unknown-none-elf)
- #149271 (feat: dlopen Enzyme)
- #149459 (std: sys: fs: uefi: Implement set_times and set_perm)
- #149771 (bootstrap readme: make easy to read when editor wrapping is not enabled)
- #149856 (Provide an extended framework for type visit, for use in rust-analyzer)
- #149950 (Simplify how inline asm handles
MaybeUninit) - #150014 (Metadata loader cleanups)
- #150021 (document that mpmc channels deliver an item to (at most) one receiver)
- #150029 (Update books)
- #150031 (assert impossible branch is impossible)
- #150034 (do not add
I-prioritizewhenF-*labels are present) - #150036 (Use the embeddable filename for coverage artifacts)
r? @ghost
@rustbot modify labels: rollup
rust-timer added a commit that referenced this pull request
Rollup merge of #149950 - WaffleLapkin:inlines-ur-mu-into-asm, r=jdonszelmann
Simplify how inline asm handles MaybeUninit
This is just better, but this is also allows it to handle changes from #149614 (i.e. ManuallyDrop containing MaybeDangle).
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.