Skip to content

Commit 9bff6fc

Browse files
committed
Formatting fixes, making tidy happy
1 parent 590b789 commit 9bff6fc

File tree

4 files changed

+31
-11
lines changed

4 files changed

+31
-11
lines changed

src/librustc_infer/infer/outlives/verify.rs

+18-4
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,17 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
3636
let mut visited = FxHashSet::default();
3737
match generic {
3838
GenericKind::Param(param_ty) => self.param_bound(param_ty),
39-
GenericKind::Projection(projection_ty) => self.projection_bound(projection_ty, &mut visited),
39+
GenericKind::Projection(projection_ty) => {
40+
self.projection_bound(projection_ty, &mut visited)
41+
}
4042
}
4143
}
4244

43-
fn type_bound(&self, ty: Ty<'tcx>, visited: &mut FxHashSet<GenericArg<'tcx>>) -> VerifyBound<'tcx> {
45+
fn type_bound(
46+
&self,
47+
ty: Ty<'tcx>,
48+
visited: &mut FxHashSet<GenericArg<'tcx>>,
49+
) -> VerifyBound<'tcx> {
4450
match ty.kind {
4551
ty::Param(p) => self.param_bound(p),
4652
ty::Projection(data) => self.projection_bound(data, visited),
@@ -140,7 +146,11 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
140146
self.declared_projection_bounds_from_trait(projection_ty)
141147
}
142148

143-
pub fn projection_bound(&self, projection_ty: ty::ProjectionTy<'tcx>, visited: &mut FxHashSet<GenericArg<'tcx>>) -> VerifyBound<'tcx> {
149+
pub fn projection_bound(
150+
&self,
151+
projection_ty: ty::ProjectionTy<'tcx>,
152+
visited: &mut FxHashSet<GenericArg<'tcx>>,
153+
) -> VerifyBound<'tcx> {
144154
debug!("projection_bound(projection_ty={:?})", projection_ty);
145155

146156
let projection_ty_as_ty =
@@ -174,7 +184,11 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
174184
VerifyBound::AnyBound(env_bounds.chain(trait_bounds).collect()).or(recursive_bound)
175185
}
176186

177-
fn recursive_bound(&self, parent: GenericArg<'tcx>, visited: &mut FxHashSet<GenericArg<'tcx>>) -> VerifyBound<'tcx> {
187+
fn recursive_bound(
188+
&self,
189+
parent: GenericArg<'tcx>,
190+
visited: &mut FxHashSet<GenericArg<'tcx>>,
191+
) -> VerifyBound<'tcx> {
178192
let mut bounds = parent
179193
.walk_shallow(visited)
180194
.filter_map(|child| match child.unpack() {

src/librustc_middle/ty/outlives.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ impl<'tcx> TyCtxt<'tcx> {
5757
}
5858
}
5959

60-
fn compute_components(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, out: &mut SmallVec<[Component<'tcx>; 4]>, visited: &mut FxHashSet<GenericArg<'tcx>>) {
60+
fn compute_components(
61+
tcx: TyCtxt<'tcx>,
62+
ty: Ty<'tcx>,
63+
out: &mut SmallVec<[Component<'tcx>; 4]>,
64+
visited: &mut FxHashSet<GenericArg<'tcx>>,
65+
) {
6166
// Descend through the types, looking for the various "base"
6267
// components and collecting them into `out`. This is not written
6368
// with `collect()` because of the need to sometimes skip subtrees

src/librustc_middle/ty/walk.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
44
use crate::ty;
55
use crate::ty::subst::{GenericArg, GenericArgKind};
6-
use smallvec::{self, SmallVec};
76
use rustc_data_structures::fx::FxHashSet;
7+
use smallvec::{self, SmallVec};
88

99
// The TypeWalker's stack is hot enough that it's worth going to some effort to
1010
// avoid heap allocations.
@@ -85,12 +85,13 @@ impl GenericArg<'tcx> {
8585
/// Iterator only walks items once.
8686
/// It accepts visited set, updates it with all visited types
8787
/// and skips any types that are already there.
88-
pub fn walk_shallow(self, visited: &mut FxHashSet<GenericArg<'tcx>>) -> impl Iterator<Item = GenericArg<'tcx>> {
88+
pub fn walk_shallow(
89+
self,
90+
visited: &mut FxHashSet<GenericArg<'tcx>>,
91+
) -> impl Iterator<Item = GenericArg<'tcx>> {
8992
let mut stack = SmallVec::new();
9093
push_inner(&mut stack, self);
91-
stack.retain(|a| {
92-
visited.insert(*a)
93-
});
94+
stack.retain(|a| visited.insert(*a));
9495
stack.into_iter()
9596
}
9697
}

src/test/ui/closures/issue-72408-nested-closures-exponential.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ fn main() {
5656
let f = dup(f);
5757

5858
println!("Type size was at least {}", f(1));
59-
}
59+
}

0 commit comments

Comments
 (0)