Rustup to rustc 1.79.0-nightly (fb898629a
2024-04-21)
This commit is contained in:
parent
8bc15fb2da
commit
d0c5141257
@ -1,3 +1,3 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2024-04-20"
|
||||
channel = "nightly-2024-04-22"
|
||||
components = ["rust-src", "rustc-dev", "llvm-tools"]
|
||||
|
@ -825,7 +825,7 @@ fn is_fat_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
|
||||
};
|
||||
let data = codegen_operand(fx, data);
|
||||
let meta = codegen_operand(fx, meta);
|
||||
let ptr_val = CValue::pointer_from_data_and_meta(data, meta, layout);
|
||||
let ptr_val = CValue::pointer_from_data_and_meta(fx, data, meta, layout);
|
||||
lval.write_cvalue(fx, ptr_val);
|
||||
}
|
||||
Rvalue::Aggregate(ref kind, ref operands) => {
|
||||
|
@ -99,17 +99,18 @@ pub(crate) fn by_val_pair(
|
||||
///
|
||||
/// Panics if the `layout` is not a raw pointer.
|
||||
pub(crate) fn pointer_from_data_and_meta(
|
||||
fx: &mut FunctionCx<'_, '_, 'tcx>,
|
||||
data: CValue<'tcx>,
|
||||
meta: CValue<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
) -> CValue<'tcx> {
|
||||
assert!(data.layout().ty.is_unsafe_ptr());
|
||||
assert!(layout.ty.is_unsafe_ptr());
|
||||
let inner = match (data.0, meta.0) {
|
||||
(CValueInner::ByVal(p), CValueInner::ByVal(m)) => CValueInner::ByValPair(p, m),
|
||||
(p @ CValueInner::ByVal(_), CValueInner::ByRef(..)) if meta.1.is_zst() => p,
|
||||
_ => bug!("RawPtr operands {data:?} {meta:?}"),
|
||||
};
|
||||
CValue(inner, layout)
|
||||
if meta.layout().is_zst() {
|
||||
data.cast_pointer_to(layout)
|
||||
} else {
|
||||
CValue::by_val_pair(data.load_scalar(fx), meta.load_scalar(fx), layout)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn layout(&self) -> TyAndLayout<'tcx> {
|
||||
|
Loading…
Reference in New Issue
Block a user