mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Clippy
This commit is contained in:
parent
92b5b0ef42
commit
666becad87
2 changed files with 17 additions and 21 deletions
|
@ -611,8 +611,7 @@ fn canonicalize_opaque<'a>(
|
||||||
ability_name: ability,
|
ability_name: ability,
|
||||||
impls: impl_map,
|
impls: impl_map,
|
||||||
});
|
});
|
||||||
} else {
|
} else if ability.is_builtin_ability() {
|
||||||
if ability.is_builtin_ability() {
|
|
||||||
derived_abilities.push(Loc::at(region, ability));
|
derived_abilities.push(Loc::at(region, ability));
|
||||||
supported_abilities.push(OpaqueSupports::Derived(ability));
|
supported_abilities.push(OpaqueSupports::Derived(ability));
|
||||||
} else {
|
} else {
|
||||||
|
@ -625,7 +624,6 @@ fn canonicalize_opaque<'a>(
|
||||||
env.problem(Problem::IllegalClaimedAbility(region));
|
env.problem(Problem::IllegalClaimedAbility(region));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: properly validate all supported_abilities
|
// TODO: properly validate all supported_abilities
|
||||||
if !derived_abilities.is_empty() {
|
if !derived_abilities.is_empty() {
|
||||||
|
@ -693,15 +691,12 @@ pub(crate) fn canonicalize_defs<'a>(
|
||||||
if let Ok(type_index) = either_index.split() {
|
if let Ok(type_index) = either_index.split() {
|
||||||
let type_def = &loc_defs.type_defs[type_index.index()];
|
let type_def = &loc_defs.type_defs[type_index.index()];
|
||||||
let pending_type_def = to_pending_type_def(env, type_def, scope, pattern_type);
|
let pending_type_def = to_pending_type_def(env, type_def, scope, pattern_type);
|
||||||
match &pending_type_def {
|
if let PendingTypeDef::Ability { name, members } = &pending_type_def {
|
||||||
PendingTypeDef::Ability { name, members } => {
|
|
||||||
pending_abilities_in_scope.insert(
|
pending_abilities_in_scope.insert(
|
||||||
name.value,
|
name.value,
|
||||||
members.iter().map(|mem| mem.name.value).collect(),
|
members.iter().map(|mem| mem.name.value).collect(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
_ => {}
|
|
||||||
}
|
|
||||||
pending_type_defs.push(pending_type_def);
|
pending_type_defs.push(pending_type_def);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -714,7 +709,7 @@ pub(crate) fn canonicalize_defs<'a>(
|
||||||
let pending = to_pending_value_def(
|
let pending = to_pending_value_def(
|
||||||
env,
|
env,
|
||||||
var_store,
|
var_store,
|
||||||
&value_def,
|
value_def,
|
||||||
scope,
|
scope,
|
||||||
&pending_abilities_in_scope,
|
&pending_abilities_in_scope,
|
||||||
&mut output,
|
&mut output,
|
||||||
|
|
|
@ -175,6 +175,7 @@ pub enum DestructType {
|
||||||
Guard(Variable, Loc<Pattern>),
|
Guard(Variable, Loc<Pattern>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn canonicalize_def_header_pattern<'a>(
|
pub fn canonicalize_def_header_pattern<'a>(
|
||||||
env: &mut Env<'a>,
|
env: &mut Env<'a>,
|
||||||
var_store: &mut VarStore,
|
var_store: &mut VarStore,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue