Skip to content

Commit efea759

Browse files
committed
Auto merge of #150041 - Zalathar:rollup-sa5nez6, r=Zalathar
Rollup of 13 pull requests Successful merges: - rust-lang/rust#148756 (Warn on codegen attributes on required trait methods) - rust-lang/rust#148790 (Add new Tier-3 target: riscv64im-unknown-none-elf) - rust-lang/rust#149271 (feat: dlopen Enzyme) - rust-lang/rust#149459 (std: sys: fs: uefi: Implement set_times and set_perm) - rust-lang/rust#149771 (bootstrap readme: make easy to read when editor wrapping is not enabled) - rust-lang/rust#149856 (Provide an extended framework for type visit, for use in rust-analyzer) - rust-lang/rust#149950 (Simplify how inline asm handles `MaybeUninit`) - rust-lang/rust#150014 (Metadata loader cleanups) - rust-lang/rust#150021 (document that mpmc channels deliver an item to (at most) one receiver) - rust-lang/rust#150029 (Update books) - rust-lang/rust#150031 (assert impossible branch is impossible) - rust-lang/rust#150034 (do not add `I-prioritize` when `F-*` labels are present) - rust-lang/rust#150036 (Use the embeddable filename for coverage artifacts) r? `@ghost` `@rustbot` modify labels: rollup
2 parents aff967a + 2ff03c6 commit efea759

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

src/inline_asm.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -857,19 +857,9 @@ fn call_inline_asm<'tcx>(
857857

858858
fn asm_clif_type<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> Option<types::Type> {
859859
match ty.kind() {
860-
// Adapted from https://github.com/rust-lang/rust/blob/f3c66088610c1b80110297c2d9a8b5f9265b013f/compiler/rustc_hir_analysis/src/check/intrinsicck.rs#L136-L151
860+
// Adapted from https://github.com/rust-lang/rust/blob/df44a57fd29fca899ce473f85ed64efd0708dd7c/compiler/rustc_hir_typeck/src/inline_asm.rs#L180-L183
861861
ty::Adt(adt, args) if fx.tcx.is_lang_item(adt.did(), LangItem::MaybeUninit) => {
862-
let fields = &adt.non_enum_variant().fields;
863-
let ty = fields[FieldIdx::ONE].ty(fx.tcx, args);
864-
let ty::Adt(ty, args) = ty.kind() else {
865-
unreachable!("expected first field of `MaybeUninit` to be an ADT")
866-
};
867-
assert!(
868-
ty.is_manually_drop(),
869-
"expected first field of `MaybeUninit` to be `ManuallyDrop`"
870-
);
871-
let fields = &ty.non_enum_variant().fields;
872-
let ty = fields[FieldIdx::ZERO].ty(fx.tcx, args);
862+
let ty = args.type_at(0);
873863
fx.clif_type(ty)
874864
}
875865
_ => fx.clif_type(ty),

0 commit comments

Comments
 (0)