Skip to content

Commit 110b3b9

Browse files
committed
canonicalizer.rs: rustfmt
1 parent 42f401d commit 110b3b9

File tree

1 file changed

+18
-24
lines changed

1 file changed

+18
-24
lines changed

src/librustc/infer/canonical/canonicalizer.rs

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
4848
pub fn canonicalize_query<V>(
4949
&self,
5050
value: &V,
51-
var_values: &mut SmallCanonicalVarValues<'tcx>
51+
var_values: &mut SmallCanonicalVarValues<'tcx>,
5252
) -> Canonicalized<'gcx, V>
5353
where
5454
V: TypeFoldable<'tcx> + Lift<'gcx>,
@@ -96,10 +96,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
9696
/// out the [chapter in the rustc guide][c].
9797
///
9898
/// [c]: https://rust-lang-nursery.github.io/rustc-guide/traits/canonicalization.html#canonicalizing-the-query-result
99-
pub fn canonicalize_response<V>(
100-
&self,
101-
value: &V,
102-
) -> Canonicalized<'gcx, V>
99+
pub fn canonicalize_response<V>(&self, value: &V) -> Canonicalized<'gcx, V>
103100
where
104101
V: TypeFoldable<'tcx> + Lift<'gcx>,
105102
{
@@ -112,7 +109,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
112109
static_region: false,
113110
other_free_regions: false,
114111
},
115-
&mut var_values
112+
&mut var_values,
116113
)
117114
}
118115

@@ -128,7 +125,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
128125
pub fn canonicalize_hr_query_hack<V>(
129126
&self,
130127
value: &V,
131-
var_values: &mut SmallCanonicalVarValues<'tcx>
128+
var_values: &mut SmallCanonicalVarValues<'tcx>,
132129
) -> Canonicalized<'gcx, V>
133130
where
134131
V: TypeFoldable<'tcx> + Lift<'gcx>,
@@ -147,7 +144,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
147144
static_region: false,
148145
other_free_regions: true,
149146
},
150-
var_values
147+
var_values,
151148
)
152149
}
153150
}
@@ -192,8 +189,7 @@ impl<'cx, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Canonicalizer<'cx, 'gcx, 'tcx>
192189
}
193190

194191
ty::ReVar(vid) => {
195-
let r = self
196-
.infcx
192+
let r = self.infcx
197193
.unwrap()
198194
.borrow_region_constraints()
199195
.opportunistic_resolve_var(self.tcx, vid);
@@ -305,7 +301,7 @@ impl<'cx, 'gcx, 'tcx> Canonicalizer<'cx, 'gcx, 'tcx> {
305301
infcx: Option<&'cx InferCtxt<'cx, 'gcx, 'tcx>>,
306302
tcx: TyCtxt<'cx, 'gcx, 'tcx>,
307303
canonicalize_region_mode: CanonicalizeRegionMode,
308-
var_values: &'cx mut SmallCanonicalVarValues<'tcx>
304+
var_values: &'cx mut SmallCanonicalVarValues<'tcx>,
309305
) -> Canonicalized<'gcx, V>
310306
where
311307
V: TypeFoldable<'tcx> + Lift<'gcx>,
@@ -398,25 +394,23 @@ impl<'cx, 'gcx, 'tcx> Canonicalizer<'cx, 'gcx, 'tcx> {
398394
// fill up `indices` to facilitate subsequent lookups.
399395
if var_values.spilled() {
400396
assert!(indices.is_empty());
401-
*indices =
402-
var_values.iter()
403-
.enumerate()
404-
.map(|(i, &kind)| (kind, CanonicalVar::new(i)))
405-
.collect();
397+
*indices = var_values
398+
.iter()
399+
.enumerate()
400+
.map(|(i, &kind)| (kind, CanonicalVar::new(i)))
401+
.collect();
406402
}
407403
// The cv is the index of the appended element.
408404
CanonicalVar::new(var_values.len() - 1)
409405
}
410406
} else {
411407
// `var_values` is large. Do a hashmap search via `indices`.
412-
*indices
413-
.entry(kind)
414-
.or_insert_with(|| {
415-
variables.push(info);
416-
var_values.push(kind);
417-
assert_eq!(variables.len(), var_values.len());
418-
CanonicalVar::new(variables.len() - 1)
419-
})
408+
*indices.entry(kind).or_insert_with(|| {
409+
variables.push(info);
410+
var_values.push(kind);
411+
assert_eq!(variables.len(), var_values.len());
412+
CanonicalVar::new(variables.len() - 1)
413+
})
420414
}
421415
}
422416

0 commit comments

Comments
 (0)