Skip to content

Conversation

@WaffleLapkin
Copy link
Member

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
@WaffleLapkin WaffleLapkin marked this pull request as ready for review December 13, 2025 14:22
@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
Copy link
Collaborator

rustbot commented Dec 13, 2025

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
Copy link
Member

taiki-e commented Dec 13, 2025

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 WaffleLapkin force-pushed the inlines-ur-mu-into-asm branch from df44a57 to cfb6a1f Compare December 13, 2025 14:51
@rustbot
Copy link
Collaborator

rustbot commented Dec 13, 2025

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@WaffleLapkin
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants