auto clippy fixes

This commit is contained in:
Folkert 2023-06-26 20:42:50 +02:00
parent 72c85efc83
commit ef39bad7c6
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
146 changed files with 750 additions and 1005 deletions

View file

@ -1322,8 +1322,7 @@ pub fn type_implementing_specialization(
.filter(|mia| mia.ability == ability)
.count()
} < 2,
"Multiple variables bound to an ability - this is ambiguous and should have been caught in canonicalization: {:?}",
specialization_must_implement_constraints
"Multiple variables bound to an ability - this is ambiguous and should have been caught in canonicalization: {specialization_must_implement_constraints:?}"
);
specialization_must_implement_constraints

View file

@ -27,14 +27,14 @@ impl Pools {
pub fn get_mut(&mut self, rank: Rank) -> &mut Vec<Variable> {
match self.0.get_mut(rank.into_usize()) {
Some(reference) => reference,
None => panic!("Compiler bug: could not find pool at rank {}", rank),
None => panic!("Compiler bug: could not find pool at rank {rank}"),
}
}
pub fn get(&self, rank: Rank) -> &Vec<Variable> {
match self.0.get(rank.into_usize()) {
Some(reference) => reference,
None => panic!("Compiler bug: could not find pool at rank {}", rank),
None => panic!("Compiler bug: could not find pool at rank {rank}"),
}
}

View file

@ -404,7 +404,7 @@ fn solve(
if it.peek().is_some() {
let failing: Vec<_> = it.collect();
println!("Rigids {:?}", &rigid_vars);
println!("Failing {:?}", failing);
println!("Failing {failing:?}");
debug_assert!(false);
}
});
@ -1739,8 +1739,7 @@ fn check_ability_specialization(
);
debug_assert!(
!awaiting_specializations.waiting_for(impl_key),
"still have lambda sets waiting for {:?}, but it was just resolved",
impl_key
"still have lambda sets waiting for {impl_key:?}, but it was just resolved"
);
}
}

View file

@ -187,9 +187,9 @@ fn trace_compaction_step_1(subs: &Subs, c_a: Variable, uls_a: &[Variable]) {
.collect::<Vec<_>>()
.join(",");
eprintln!("===lambda set compaction===");
eprintln!(" concrete type: {:?}", c_a);
eprintln!(" concrete type: {c_a:?}");
eprintln!(" step 1:");
eprintln!(" uls_a = {{ {} }}", uls_a);
eprintln!(" uls_a = {{ {uls_a} }}");
}
#[cfg(debug_assertions)]
@ -205,7 +205,7 @@ fn trace_compaction_step_2(subs: &Subs, uls_a: &[Variable]) {
.collect::<Vec<_>>()
.join(",");
eprintln!(" step 2:");
eprintln!(" uls_a' = {{ {} }}", uls_a);
eprintln!(" uls_a' = {{ {uls_a} }}");
}
#[cfg(debug_assertions)]
@ -226,9 +226,9 @@ fn trace_compaction_step_3iter_start(
);
let t_f1 = roc_types::subs::SubsFmtContent(subs.get_content_without_compacting(t_f1), subs);
let t_f2 = roc_types::subs::SubsFmtContent(subs.get_content_without_compacting(t_f2), subs);
eprintln!(" - iteration: {:?}", iteration_lambda_set);
eprintln!(" {:?}", t_f1);
eprintln!(" ~ {:?}", t_f2);
eprintln!(" - iteration: {iteration_lambda_set:?}");
eprintln!(" {t_f1:?}");
eprintln!(" ~ {t_f2:?}");
}
#[cfg(debug_assertions)]
@ -239,7 +239,7 @@ fn trace_compaction_step_3iter_end(subs: &Subs, t_f_result: Variable, skipped: b
if skipped {
eprintln!(" SKIP");
}
eprintln!(" = {:?}\n", t_f_result);
eprintln!(" = {t_f_result:?}\n");
}
macro_rules! trace_compact {
@ -536,7 +536,7 @@ fn compact_lambda_set<P: Phase>(
Err(()) => {
// Do nothing other than to remove the concrete lambda to drop from the lambda set,
// which we already did in 1b above.
trace_compact!(3iter_end_skipped. env.subs, t_f1);
trace_compact!(3iter_end_skipped.env.subs, t_f1);
return OneCompactionResult::Compacted {
new_obligations: Default::default(),
new_lambda_sets_to_specialize: Default::default(),
@ -559,7 +559,7 @@ fn compact_lambda_set<P: Phase>(
Err(()) => {
// Do nothing other than to remove the concrete lambda to drop from the lambda set,
// which we already did in 1b above.
trace_compact!(3iter_end_skipped. env.subs, t_f1);
trace_compact!(3iter_end_skipped.env.subs, t_f1);
return OneCompactionResult::Compacted {
new_obligations: Default::default(),
new_lambda_sets_to_specialize: Default::default(),
@ -572,7 +572,7 @@ fn compact_lambda_set<P: Phase>(
let t_f2 = deep_copy_var_in(env, target_rank, t_f2, env.arena);
// 3. Unify `t_f1 ~ t_f2`.
trace_compact!(3iter_start. env.subs, this_lambda_set, t_f1, t_f2);
trace_compact!(3iter_start.env.subs, this_lambda_set, t_f1, t_f2);
let (vars, new_obligations, new_lambda_sets_to_specialize, _meta) = unify(
&mut env.uenv(),
t_f1,
@ -581,7 +581,7 @@ fn compact_lambda_set<P: Phase>(
Polarity::Pos,
)
.expect_success("ambient functions don't unify");
trace_compact!(3iter_end. env.subs, t_f1);
trace_compact!(3iter_end.env.subs, t_f1);
env.introduce(target_rank, &vars);