1
Fork 0
This commit is contained in:
bjorn3 2025-02-08 22:12:13 +00:00
parent 3183b44a1e
commit 1fcae03369
287 changed files with 5888 additions and 4608 deletions

View file

@ -79,10 +79,10 @@ fn assumed_wf_types<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx [(Ty<'
if matches!(*orig_lt, ty::ReLateParam(..)) {
mapping.insert(
orig_lt,
ty::Region::new_early_param(tcx, ty::EarlyParamRegion {
index: param.index,
name: param.name,
}),
ty::Region::new_early_param(
tcx,
ty::EarlyParamRegion { index: param.index, name: param.name },
),
);
}
}

View file

@ -240,14 +240,20 @@ fn layout_of_uncached<'tcx>(
}
// Basic scalars.
ty::Bool => tcx.mk_layout(LayoutData::scalar(cx, Scalar::Initialized {
value: Int(I8, false),
valid_range: WrappingRange { start: 0, end: 1 },
})),
ty::Char => tcx.mk_layout(LayoutData::scalar(cx, Scalar::Initialized {
value: Int(I32, false),
valid_range: WrappingRange { start: 0, end: 0x10FFFF },
})),
ty::Bool => tcx.mk_layout(LayoutData::scalar(
cx,
Scalar::Initialized {
value: Int(I8, false),
valid_range: WrappingRange { start: 0, end: 1 },
},
)),
ty::Char => tcx.mk_layout(LayoutData::scalar(
cx,
Scalar::Initialized {
value: Int(I32, false),
valid_range: WrappingRange { start: 0, end: 0x10FFFF },
},
)),
ty::Int(ity) => scalar(Int(abi::Integer::from_int_ty(dl, ity), true)),
ty::Uint(ity) => scalar(Int(abi::Integer::from_uint_ty(dl, ity), false)),
ty::Float(fty) => scalar(Float(abi::Float::from_float_ty(fty))),
@ -551,10 +557,13 @@ fn layout_of_uncached<'tcx>(
// Non-power-of-two vectors have padding up to the next power-of-two.
// If we're a packed repr, remove the padding while keeping the alignment as close
// to a vector as possible.
(BackendRepr::Memory { sized: true }, AbiAndPrefAlign {
abi: Align::max_for_offset(size),
pref: dl.vector_align(size).pref,
})
(
BackendRepr::Memory { sized: true },
AbiAndPrefAlign {
abi: Align::max_for_offset(size),
pref: dl.vector_align(size).pref,
},
)
} else {
(BackendRepr::Vector { element: e_abi, count: e_len }, dl.vector_align(size))
};
@ -1179,10 +1188,13 @@ fn variant_info_for_adt<'tcx>(
})
.collect();
(variant_infos, match tag_encoding {
TagEncoding::Direct => Some(tag.size(cx)),
_ => None,
})
(
variant_infos,
match tag_encoding {
TagEncoding::Direct => Some(tag.size(cx)),
_ => None,
},
)
}
}
}
@ -1302,8 +1314,11 @@ fn variant_info_for_coroutine<'tcx>(
let end_states: Vec<_> = end_states.collect();
variant_infos.extend(end_states);
(variant_infos, match tag_encoding {
TagEncoding::Direct => Some(tag.size(cx)),
_ => None,
})
(
variant_infos,
match tag_encoding {
TagEncoding::Direct => Some(tag.size(cx)),
_ => None,
},
)
}