Key the element glue on static type projections

This commit is contained in:
Dennis Kobert
2026-08-28 13:30:05 +00:00
parent d814b610da
commit c6b669fc88
8 changed files with 107 additions and 32 deletions

View File

@@ -250,7 +250,10 @@ mod tests {
EvalScope::new(Some(0.5), None, None, generations, arena)
}
fn element_layout<T: Clone + Send + Sync + 'static>() -> core_types::record::Layout {
fn element_layout<T: Clone + Send + Sync + core_types::StaticTypeSized>() -> core_types::record::Layout
where
T::Static: Clone + Send + Sync,
{
core_types::record::Layout::default().with_writes(0, core_types::record::element_write::<T>(), &[])
}
@@ -312,6 +315,7 @@ mod tests {
#[test]
fn memo_copy_out_consults_the_deep_element_clone() {
#[derive(Clone, Debug, PartialEq)]
#[derive(dyn_any::DynAny)]
struct Payload(String, u32);
unsafe fn deep(ptr: *const u8) -> Box<dyn std::any::Any + Send + Sync> {
let value = unsafe { core_types::record::borrow_element::<Payload>(core_types::record::Rec::new(ptr)) };

View File

@@ -604,7 +604,10 @@ mod tests {
node
}
fn lifted_value<T: Clone + Send + Sync + 'static>(value: T) -> (core_types::record::RecordLift<T, ValueNode<T>>, Layout) {
fn lifted_value<T: Clone + Send + Sync + core_types::StaticTypeSized + 'static>(value: T) -> (core_types::record::RecordLift<T, ValueNode<T>>, Layout)
where
T::Static: Clone + Send + Sync,
{
let lift = core_types::record::RecordLift::<T, _>::new(ValueNode(value));
let layout = Node::<ContextImpl>::layout(&lift).clone();
(lift, layout)