Skip to content

Commit 70aff78

Browse files
committed
cargo fmt as always
1 parent f8d667e commit 70aff78

File tree

11 files changed

+23
-43
lines changed

11 files changed

+23
-43
lines changed

chalk-engine/src/context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,6 @@ pub trait ContextOps<C: Context>: Sized + Clone + Debug + AggregateOps<C> {
266266
u_canon: &C::UCanonicalGoalInEnvironment,
267267
canonical_subst: &C::CanonicalAnswerSubst,
268268
) -> bool;
269-
270269
}
271270

272271
/// Methods for combining solutions to yield an aggregate solution.

chalk-engine/src/logic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,9 @@ impl<'forest, C: Context + 'forest, CO: ContextOps<C> + 'forest> SolveState<'for
14091409
// must be backed by an impl *eventually*).
14101410
let is_trivial_answer = {
14111411
!answer.ambiguous
1412-
&& self.context.is_trivial_substitution(&self.forest.tables[table].table_goal, &answer.subst)
1412+
&& self
1413+
.context
1414+
.is_trivial_substitution(&self.forest.tables[table].table_goal, &answer.subst)
14131415
&& C::empty_constraints(&answer.subst)
14141416
};
14151417

chalk-integration/src/program.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use chalk_ir::debug::Angle;
44
use chalk_ir::interner::ChalkIr;
55
use chalk_ir::tls;
66
use chalk_ir::{
7-
Ty, AliasTy, AssocTypeId, ImplId, Parameter, ProgramClause, StructId, TraitId, TyData, TypeName,
7+
AliasTy, AssocTypeId, ImplId, Parameter, ProgramClause, StructId, TraitId, Ty, TyData, TypeName,
88
};
99
use chalk_rust_ir::{
1010
AssociatedTyDatum, AssociatedTyValue, AssociatedTyValueId, ImplDatum, ImplType, StructDatum,
@@ -121,11 +121,7 @@ impl tls::DebugContext for Program {
121121
)
122122
}
123123

124-
fn debug_ty(
125-
&self,
126-
ty: &Ty<ChalkIr>,
127-
fmt: &mut fmt::Formatter<'_>,
128-
) -> Result<(), fmt::Error> {
124+
fn debug_ty(&self, ty: &Ty<ChalkIr>, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
129125
let interner = self.interner();
130126
write!(fmt, "{:?}", ty.data(interner))
131127
}

chalk-ir/src/could_match.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ where
1414
I: Interner,
1515
{
1616
fn could_match(&self, interner: &I, other: &T) -> bool {
17-
return Zip::zip_with(&mut MatchZipper{ interner }, self, other).is_ok();
17+
return Zip::zip_with(&mut MatchZipper { interner }, self, other).is_ok();
1818

1919
struct MatchZipper<'i, I> {
2020
interner: &'i I,
@@ -60,7 +60,9 @@ where
6060
impl<I: Interner> CouldMatch<DomainGoal<I>> for ProgramClause<I> {
6161
fn could_match(&self, interner: &I, other: &DomainGoal<I>) -> bool {
6262
match self {
63-
ProgramClause::Implies(implication) => implication.consequence.could_match(interner, other),
63+
ProgramClause::Implies(implication) => {
64+
implication.consequence.could_match(interner, other)
65+
}
6466

6567
ProgramClause::ForAll(clause) => clause.value.consequence.could_match(interner, other),
6668
}

chalk-ir/src/debug.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ impl<I: Interner> Debug for Ty<I> {
2727
}
2828
}
2929

30-
3130
impl Display for UniverseIndex {
3231
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error> {
3332
write!(fmt, "U{}", self.counter)

chalk-ir/src/interner.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use crate::Parameter;
77
use crate::ParameterData;
88
use crate::StructId;
99
use crate::TraitId;
10-
use crate::TyData;
1110
use crate::Ty;
11+
use crate::TyData;
1212
use chalk_engine::context::Context;
1313
use chalk_engine::ExClause;
1414
use std::fmt::{self, Debug};
@@ -140,10 +140,7 @@ pub trait Interner: Debug + Copy + Eq + Ord + Hash {
140140
///
141141
/// Returns `None` to fallback to the default debug output (e.g.,
142142
/// if no info about current program is available from TLS).
143-
fn debug_ty(
144-
ty: &Ty<Self>,
145-
fmt: &mut fmt::Formatter<'_>,
146-
) -> Option<fmt::Result>;
143+
fn debug_ty(ty: &Ty<Self>, fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result>;
147144

148145
/// Create an "interned" type from `ty`. This is not normally
149146
/// invoked directly; instead, you invoke `TyData::intern` (which
@@ -285,10 +282,7 @@ mod default {
285282
tls::with_current_program(|prog| Some(prog?.debug_alias(alias, fmt)))
286283
}
287284

288-
fn debug_ty(
289-
alias: &Ty<ChalkIr>,
290-
fmt: &mut fmt::Formatter<'_>,
291-
) -> Option<fmt::Result> {
285+
fn debug_ty(alias: &Ty<ChalkIr>, fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> {
292286
tls::with_current_program(|prog| Some(prog?.debug_ty(alias, fmt)))
293287
}
294288

chalk-ir/src/tls.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::interner::ChalkIr;
2-
use crate::{AliasTy, AssocTypeId, Ty, StructId, TraitId};
2+
use crate::{AliasTy, AssocTypeId, StructId, TraitId, Ty};
33
use std::cell::RefCell;
44
use std::fmt;
55
use std::sync::Arc;
@@ -33,11 +33,7 @@ pub trait DebugContext {
3333
fmt: &mut fmt::Formatter<'_>,
3434
) -> Result<(), fmt::Error>;
3535

36-
fn debug_ty(
37-
&self,
38-
ty: &Ty<ChalkIr>,
39-
fmt: &mut fmt::Formatter<'_>,
40-
) -> Result<(), fmt::Error>;
36+
fn debug_ty(&self, ty: &Ty<ChalkIr>, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error>;
4137
}
4238

4339
pub fn with_current_program<R>(op: impl FnOnce(Option<&Arc<dyn DebugContext>>) -> R) -> R {

chalk-solve/src/clauses.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,7 @@ fn program_clauses_that_could_match<I: Interner>(
227227
// ```
228228
// forall<'a> { Implemented(dyn Fn(&u8): Fn<(&'a u8)>) }
229229
// ```
230-
let qwc = exists_qwc
231-
.substitute(interner, &[self_ty.clone().cast(interner)]);
230+
let qwc = exists_qwc.substitute(interner, &[self_ty.clone().cast(interner)]);
232231

233232
builder.push_binders(&qwc, |builder, wc| {
234233
builder.push_fact(wc);

chalk-solve/src/infer/unify.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,17 +208,13 @@ impl<'t, I: Interner> Unifier<'t, I> {
208208

209209
{
210210
let a_universal = self.table.instantiate_binders_universally(interner, a);
211-
let b_existential = self
212-
.table
213-
.instantiate_binders_existentially(interner, b);
211+
let b_existential = self.table.instantiate_binders_existentially(interner, b);
214212
Zip::zip_with(self, &a_universal, &b_existential)?;
215213
}
216214

217215
{
218216
let b_universal = self.table.instantiate_binders_universally(interner, b);
219-
let a_existential = self
220-
.table
221-
.instantiate_binders_existentially(interner, a);
217+
let a_existential = self.table.instantiate_binders_existentially(interner, a);
222218
Zip::zip_with(self, &a_existential, &b_universal)
223219
}
224220
}

chalk-solve/src/solve/slg.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ impl<'me, I: Interner> context::ContextOps<SlgContext<I>> for SlgContextOps<'me,
337337
let interner = self.interner();
338338
u_canon.is_trivial_substitution(interner, canonical_subst)
339339
}
340-
341340
}
342341

343342
impl<I: Interner> TruncatingInferenceTable<I> {
@@ -502,7 +501,7 @@ impl<I: Interner> SubstitutionExt<I> for Substitution<I> {
502501
fn may_invalidate(&self, interner: &I, subst: &Canonical<Substitution<I>>) -> bool {
503502
self.iter()
504503
.zip(subst.value.iter())
505-
.any(|(new, current)| MayInvalidate{ interner }.aggregate_parameters( new, current))
504+
.any(|(new, current)| MayInvalidate { interner }.aggregate_parameters(new, current))
506505
}
507506
}
508507

@@ -512,11 +511,7 @@ struct MayInvalidate<'i, I> {
512511
}
513512

514513
impl<I: Interner> MayInvalidate<'_, I> {
515-
fn aggregate_parameters(
516-
&mut self,
517-
new: &Parameter<I>,
518-
current: &Parameter<I>,
519-
) -> bool {
514+
fn aggregate_parameters(&mut self, new: &Parameter<I>, current: &Parameter<I>) -> bool {
520515
match (new.data(), current.data()) {
521516
(ParameterKind::Ty(ty1), ParameterKind::Ty(ty2)) => self.aggregate_tys(ty1, ty2),
522517
(ParameterKind::Lifetime(l1), ParameterKind::Lifetime(l2)) => {
@@ -667,6 +662,6 @@ impl<I: Interner> MayInvalidate<'_, I> {
667662
new_substitution
668663
.iter()
669664
.zip(current_substitution)
670-
.any(|(new, current)| self.aggregate_parameters( new, current))
665+
.any(|(new, current)| self.aggregate_parameters(new, current))
671666
}
672667
}

0 commit comments

Comments
 (0)