Skip to content

Commit b38992c

Browse files
committed
some style fixes
1 parent 824c9eb commit b38992c

File tree

13 files changed

+91
-83
lines changed

13 files changed

+91
-83
lines changed

src/librustc/cfg/construct.rs

+15-17
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@ pub fn construct<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
5252
tables: tables,
5353
graph: graph,
5454
fn_exit: fn_exit,
55-
loop_scopes: Vec::new()
55+
loop_scopes: Vec::new(),
5656
};
5757
body_exit = cfg_builder.expr(&body.value, entry);
5858
cfg_builder.add_contained_edge(body_exit, fn_exit);
59-
let CFGBuilder {graph, ..} = cfg_builder;
60-
CFG {graph: graph,
61-
entry: entry,
62-
exit: fn_exit}
59+
let CFGBuilder { graph, .. } = cfg_builder;
60+
CFG {
61+
graph: graph,
62+
entry: entry,
63+
exit: fn_exit,
64+
}
6365
}
6466

6567
impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
@@ -81,7 +83,8 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
8183
self.add_ast_node(id, &[exit])
8284
}
8385

84-
hir::StmtExpr(ref expr, id) | hir::StmtSemi(ref expr, id) => {
86+
hir::StmtExpr(ref expr, id) |
87+
hir::StmtSemi(ref expr, id) => {
8588
let exit = self.expr(&expr, pred);
8689
self.add_ast_node(id, &[exit])
8790
}
@@ -95,9 +98,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
9598
self.pat(&local.pat, init_exit)
9699
}
97100

98-
hir::DeclItem(_) => {
99-
pred
100-
}
101+
hir::DeclItem(_) => pred,
101102
}
102103
}
103104

@@ -107,9 +108,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
107108
PatKind::Path(_) |
108109
PatKind::Lit(..) |
109110
PatKind::Range(..) |
110-
PatKind::Wild => {
111-
self.add_ast_node(pat.id, &[pred])
112-
}
111+
PatKind::Wild => self.add_ast_node(pat.id, &[pred]),
113112

114113
PatKind::Box(ref subpat) |
115114
PatKind::Ref(ref subpat, _) |
@@ -125,8 +124,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
125124
}
126125

127126
PatKind::Struct(_, ref subpats, _) => {
128-
let pats_exit =
129-
self.pats_all(subpats.iter().map(|f| &f.node.pat), pred);
127+
let pats_exit = self.pats_all(subpats.iter().map(|f| &f.node.pat), pred);
130128
self.add_ast_node(pat.id, &[pats_exit])
131129
}
132130

@@ -385,7 +383,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
385383
let method_call = ty::MethodCall::expr(call_expr.id);
386384
let fn_ty = match self.tables.method_map.get(&method_call) {
387385
Some(method) => method.ty,
388-
None => self.tables.expr_ty_adjusted(func_or_rcvr)
386+
None => self.tables.expr_ty_adjusted(func_or_rcvr),
389387
};
390388

391389
let func_or_rcvr_exit = self.expr(func_or_rcvr, pred);
@@ -556,7 +554,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
556554
from_index: CFGIndex,
557555
to_loop: LoopScope,
558556
to_index: CFGIndex) {
559-
let mut data = CFGEdgeData {exiting_scopes: vec![] };
557+
let mut data = CFGEdgeData { exiting_scopes: vec![] };
560558
let mut scope = self.tcx.region_maps.node_extent(from_expr.id);
561559
let target_scope = self.tcx.region_maps.node_extent(to_loop.loop_id);
562560
while scope != target_scope {
@@ -591,7 +589,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
591589
}
592590
span_bug!(expr.span, "no loop scope for id {}", loop_id);
593591
}
594-
Err(err) => span_bug!(expr.span, "loop scope error: {}", err)
592+
Err(err) => span_bug!(expr.span, "loop scope error: {}", err),
595593
}
596594
}
597595
}

src/librustc/dep_graph/dep_tracking_map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl<M: DepTrackingMapConfig> DepTrackingMap<M> {
3939
DepTrackingMap {
4040
phantom: PhantomData,
4141
graph: graph,
42-
map: FxHashMap()
42+
map: FxHashMap(),
4343
}
4444
}
4545

src/librustc/dep_graph/visit.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn visit_all_item_likes_in_krate<'a, 'tcx, V, F>(tcx: TyCtxt<'a, 'tcx, 'tcx>
2929
struct TrackingVisitor<'visit, 'tcx: 'visit, F: 'visit, V: 'visit> {
3030
tcx: TyCtxt<'visit, 'tcx, 'tcx>,
3131
dep_node_fn: &'visit mut F,
32-
visitor: &'visit mut V
32+
visitor: &'visit mut V,
3333
}
3434

3535
impl<'visit, 'tcx, F, V> ItemLikeVisitor<'tcx> for TrackingVisitor<'visit, 'tcx, F, V>
@@ -70,13 +70,16 @@ pub fn visit_all_item_likes_in_krate<'a, 'tcx, V, F>(tcx: TyCtxt<'a, 'tcx, 'tcx>
7070
let mut tracking_visitor = TrackingVisitor {
7171
tcx: tcx,
7272
dep_node_fn: &mut dep_node_fn,
73-
visitor: visitor
73+
visitor: visitor,
7474
};
7575
krate.visit_all_item_likes(&mut tracking_visitor)
7676
}
7777

7878
pub fn visit_all_bodies_in_krate<'a, 'tcx, C>(tcx: TyCtxt<'a, 'tcx, 'tcx>, callback: C)
79-
where C: Fn(/* body_owner */ DefId, /* body id */ hir::BodyId),
79+
where C: Fn(/* body_owner */
80+
DefId,
81+
/* body id */
82+
hir::BodyId)
8083
{
8184
let krate = tcx.hir.krate();
8285
for &body_id in &krate.body_ids {

src/librustc/lint/context.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,19 @@ impl<'a, S: Into<MultiSpan>> IntoEarlyLint for (S, &'a str) {
113113
let (span, msg) = self;
114114
let mut diagnostic = Diagnostic::new(errors::Level::Warning, msg);
115115
diagnostic.set_span(span);
116-
EarlyLint { id: id, diagnostic: diagnostic }
116+
EarlyLint {
117+
id: id,
118+
diagnostic: diagnostic,
119+
}
117120
}
118121
}
119122

120123
impl IntoEarlyLint for Diagnostic {
121124
fn into_early_lint(self, id: LintId) -> EarlyLint {
122-
EarlyLint { id: id, diagnostic: self }
125+
EarlyLint {
126+
id: id,
127+
diagnostic: self,
128+
}
123129
}
124130
}
125131

@@ -146,7 +152,7 @@ enum TargetLint {
146152

147153
enum FindLintError {
148154
NotFound,
149-
Removed
155+
Removed,
150156
}
151157

152158
impl LintStore {
@@ -1127,7 +1133,7 @@ enum CheckLintNameResult {
11271133
NoLint,
11281134
// The lint is either renamed or removed. This is the warning
11291135
// message.
1130-
Warning(String)
1136+
Warning(String),
11311137
}
11321138

11331139
/// Checks the name of a lint for its existence, and whether it was

src/librustc/session/code_stats.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ pub struct VariantInfo {
2525
}
2626

2727
#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)]
28-
pub enum SizeKind { Exact, Min }
28+
pub enum SizeKind {
29+
Exact,
30+
Min,
31+
}
2932

3033
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
3134
pub struct FieldInfo {

src/librustc/traits/specialize/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub mod specialization_graph;
3737
pub struct OverlapError {
3838
pub with_impl: DefId,
3939
pub trait_desc: String,
40-
pub self_desc: Option<String>
40+
pub self_desc: Option<String>,
4141
}
4242

4343
/// Given a subst for the requested impl, translate it to a subst
@@ -274,7 +274,7 @@ fn fulfill_implication<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
274274
}
275275

276276
pub struct SpecializesCache {
277-
map: FxHashMap<(DefId, DefId), bool>
277+
map: FxHashMap<(DefId, DefId), bool>,
278278
}
279279

280280
impl SpecializesCache {

src/librustc/ty/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use hir;
2323
#[derive(Clone, Copy, Debug)]
2424
pub struct ExpectedFound<T> {
2525
pub expected: T,
26-
pub found: T
26+
pub found: T,
2727
}
2828

2929
// Data structures used in type unification

src/librustc/ty/item_path.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -374,14 +374,13 @@ impl LocalPathBuffer {
374374
fn new(root_mode: RootMode) -> LocalPathBuffer {
375375
LocalPathBuffer {
376376
root_mode: root_mode,
377-
str: String::new()
377+
str: String::new(),
378378
}
379379
}
380380

381381
fn into_string(self) -> String {
382382
self.str
383383
}
384-
385384
}
386385

387386
impl ItemPathBuffer for LocalPathBuffer {

src/librustc/ty/maps.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'tcx> Value<'tcx> for Ty<'tcx> {
8585

8686
pub struct CycleError<'a> {
8787
span: Span,
88-
cycle: RefMut<'a, [(Span, Query)]>
88+
cycle: RefMut<'a, [(Span, Query)]>,
8989
}
9090

9191
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {

0 commit comments

Comments
 (0)