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 }})

@WaffleLapkin

This is just better, but this is also allows it to handle changes from #149614 (i.e. ManuallyDrop containing MaybeDangle).

@rustbot rustbot added S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Dec 13, 2025

@rustbot 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

Dec 13, 2025

@rustbot

r? @jdonszelmann

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

@taiki-e

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);

@WaffleLapkin

@rustbot

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@WaffleLapkin

@taiki-e good catch, I've updated it too.

bjorn3

@jdonszelmann

@bors

📌 Commit cfb6a1f has been approved by jdonszelmann

It is now in the queue for this repository.

@bors 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

Dec 15, 2025

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Dec 15, 2025

@matthiaskrgr

…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

Dec 15, 2025

@bors

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Dec 15, 2025

@matthiaskrgr

…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

Dec 15, 2025

@bors

Rollup of 8 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

Zalathar added a commit to Zalathar/rust that referenced this pull request

Dec 16, 2025

@Zalathar

…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

Dec 16, 2025

@bors

Rollup of 14 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit that referenced this pull request

Dec 16, 2025

@bors

Rollup of 13 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit that referenced this pull request

Dec 16, 2025

@rust-timer

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

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.