Rustup to rustc 1.79.0-nightly (fb898629a 2024-04-21)

This commit is contained in:
bjorn3 2024-04-22 16:56:37 +00:00
parent 8bc15fb2da
commit d0c5141257
3 changed files with 9 additions and 8 deletions

View File

@ -1,3 +1,3 @@
[toolchain] [toolchain]
channel = "nightly-2024-04-20" channel = "nightly-2024-04-22"
components = ["rust-src", "rustc-dev", "llvm-tools"] components = ["rust-src", "rustc-dev", "llvm-tools"]

View File

@ -825,7 +825,7 @@ fn is_fat_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
}; };
let data = codegen_operand(fx, data); let data = codegen_operand(fx, data);
let meta = codegen_operand(fx, meta); 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); lval.write_cvalue(fx, ptr_val);
} }
Rvalue::Aggregate(ref kind, ref operands) => { Rvalue::Aggregate(ref kind, ref operands) => {

View File

@ -99,17 +99,18 @@ pub(crate) fn by_val_pair(
/// ///
/// Panics if the `layout` is not a raw pointer. /// Panics if the `layout` is not a raw pointer.
pub(crate) fn pointer_from_data_and_meta( pub(crate) fn pointer_from_data_and_meta(
fx: &mut FunctionCx<'_, '_, 'tcx>,
data: CValue<'tcx>, data: CValue<'tcx>,
meta: CValue<'tcx>, meta: CValue<'tcx>,
layout: TyAndLayout<'tcx>, layout: TyAndLayout<'tcx>,
) -> CValue<'tcx> { ) -> CValue<'tcx> {
assert!(data.layout().ty.is_unsafe_ptr());
assert!(layout.ty.is_unsafe_ptr()); assert!(layout.ty.is_unsafe_ptr());
let inner = match (data.0, meta.0) { if meta.layout().is_zst() {
(CValueInner::ByVal(p), CValueInner::ByVal(m)) => CValueInner::ByValPair(p, m), data.cast_pointer_to(layout)
(p @ CValueInner::ByVal(_), CValueInner::ByRef(..)) if meta.1.is_zst() => p, } else {
_ => bug!("RawPtr operands {data:?} {meta:?}"), CValue::by_val_pair(data.load_scalar(fx), meta.load_scalar(fx), layout)
}; }
CValue(inner, layout)
} }
pub(crate) fn layout(&self) -> TyAndLayout<'tcx> { pub(crate) fn layout(&self) -> TyAndLayout<'tcx> {