This commit is contained in:
Anton-4 2024-04-15 19:36:52 +02:00
parent a7b843743d
commit dc96e194bd
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
3 changed files with 7 additions and 4 deletions

View file

@ -2161,13 +2161,13 @@ impl<'a> LowLevelCall<'a> {
// Empty record is always equal to empty record.
// There are no runtime arguments to check, so just emit true or false.
LayoutRepr::Struct(field_layouts) if field_layouts.is_empty() => {
LayoutRepr::Struct([]) => {
backend.code_builder.i32_const(!invert_result as i32);
}
// Void is always equal to void. This is the type for the contents of the empty list in `[] == []`
// This instruction will never execute, but we need an i32 for module validation
LayoutRepr::Union(UnionLayout::NonRecursive(tags)) if tags.is_empty() => {
LayoutRepr::Union(UnionLayout::NonRecursive([])) => {
backend.code_builder.i32_const(!invert_result as i32);
}

View file

@ -250,9 +250,12 @@ fn crash_kw<'a>() -> impl Parser<'a, Expr<'a>, EExpr<'a>> {
}
}
// avoids ownership issues
#[allow(clippy::blocks_in_conditions)]
fn loc_possibly_negative_or_negated_term<'a>(
options: ExprParseOptions,
) -> impl Parser<'a, Loc<Expr<'a>>, EExpr<'a>> {
one_of![
|arena, state: State<'a>, min_indent: u32| {
let initial = state.clone();

View file

@ -2913,7 +2913,7 @@ where
pub fn iter_all(
&self,
) -> impl Iterator<Item = (SubsIndex<L>, SubsIndex<VariableSubsSlice>)> + ExactSizeIterator
) -> impl ExactSizeIterator<Item = (SubsIndex<L>, SubsIndex<VariableSubsSlice>)>
{
self.labels().into_iter().zip(self.variables())
}
@ -2923,7 +2923,7 @@ where
pub fn iter_from_subs<'a>(
&'a self,
subs: &'a Subs,
) -> impl Iterator<Item = (&'a L, &'a [Variable])> + ExactSizeIterator {
) -> impl ExactSizeIterator<Item = (&'a L, &'a [Variable])> {
self.iter_all().map(move |(name_index, payload_index)| {
(
L::index_subs(subs, name_index),