mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Fix broken subtree sync
This commit is contained in:
parent
7c968a2108
commit
96152c7df3
@ -95,23 +95,6 @@ impl<'tcx> CValue<'tcx> {
|
||||
CValue(CValueInner::ByValPair(value, extra), layout)
|
||||
}
|
||||
|
||||
/// For `AggregateKind::RawPtr`, create a pointer from its parts.
|
||||
///
|
||||
/// Panics if the `layout` is not a raw pointer.
|
||||
pub(crate) fn pointer_from_data_and_meta(
|
||||
data: CValue<'tcx>,
|
||||
meta: CValue<'tcx>,
|
||||
layout: TyAndLayout<'tcx>,
|
||||
) -> CValue<'tcx> {
|
||||
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)
|
||||
}
|
||||
|
||||
pub(crate) fn layout(&self) -> TyAndLayout<'tcx> {
|
||||
self.1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user