Handle values that are functions in expects

This commit is contained in:
Ayaz Hafiz 2022-09-07 14:03:21 -05:00
parent 4046d883c9
commit a8282f36c3
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -219,7 +219,9 @@ fn build_clone<'a, 'ctx, 'env>(
when_recursive,
),
Layout::LambdaSet(_) => unreachable!("cannot compare closures"),
// Since we will never actually display functions (and hence lambda sets), we can just pass
// back the nullptr.
Layout::LambdaSet(_) => env.ptr_int().const_zero(),
Layout::Union(union_layout) => {
if layout.safe_to_memcpy(env.layout_interner) {