Skip to content

Commit f61b4af

Browse files
pcwaltonpnkfelix
authored andcommitted
librustc/libsyntax whitespace cleanup.
1 parent 59ea990 commit f61b4af

File tree

11 files changed

+78
-36
lines changed

11 files changed

+78
-36
lines changed

src/librustc/metadata/decoder.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -808,11 +808,10 @@ pub fn get_impl_methods(cdata: Cmd, impl_id: ast::NodeId) -> Vec<ast::DefId> {
808808
methods
809809
}
810810

811-
pub fn get_method_name_and_explicit_self(
812-
intr: Rc<IdentInterner>,
813-
cdata: Cmd,
814-
id: ast::NodeId) -> (ast::Ident, ast::ExplicitSelf_)
815-
{
811+
pub fn get_method_name_and_explicit_self(intr: Rc<IdentInterner>,
812+
cdata: Cmd,
813+
id: ast::NodeId)
814+
-> (ast::Ident, ast::ExplicitSelf_) {
816815
let method_doc = lookup_item(id, cdata.data());
817816
let name = item_name(&*intr, method_doc);
818817
let explicit_self = get_explicit_self(method_doc);

src/librustc/metadata/tydecode.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,8 @@ fn parse_mt(st: &mut PState, mut conv: conv_did) -> ty::mt {
428428
}
429429
}
430430

431-
fn parse_def(st: &mut PState, source: DefIdSource,
432-
conv: conv_did) -> ast::DefId {
431+
fn parse_def(st: &mut PState, source: DefIdSource, conv: conv_did)
432+
-> ast::DefId {
433433
return conv(source, scan(st, |c| { c == '|' }, parse_def_id));
434434
}
435435

@@ -525,10 +525,12 @@ fn parse_sig(st: &mut PState, mut conv: conv_did) -> ty::FnSig {
525525
r => fail!(format!("bad variadic: {}", r)),
526526
};
527527
let ret_ty = parse_ty(st, |x,y| (*conv_ptr)(x,y));
528-
ty::FnSig {binder_id: id,
529-
inputs: inputs,
530-
output: ret_ty,
531-
variadic: variadic}
528+
ty::FnSig {
529+
binder_id: id,
530+
inputs: inputs,
531+
output: ret_ty,
532+
variadic: variadic,
533+
}
532534
}
533535

534536
// Rust metadata parsing

src/librustc/middle/borrowck/check_loans.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,8 +676,9 @@ impl<'a> CheckLoanCtxt<'a> {
676676
true
677677
}
678678
});
679-
680-
if !cont { return false }
679+
if !cont {
680+
return false
681+
}
681682
}
682683
}
683684
}

src/librustc/middle/kind.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ fn check_struct_safe_for_destructor(cx: &mut Context,
112112
}
113113
}
114114

115-
fn check_impl_of_trait(cx: &mut Context, it: &Item, trait_ref: &TraitRef, self_type: &Ty) {
115+
fn check_impl_of_trait(cx: &mut Context,
116+
it: &Item,
117+
trait_ref: &TraitRef,
118+
self_type: &Ty) {
116119
let ast_trait_def = *cx.tcx.def_map.borrow()
117120
.find(&trait_ref.ref_id)
118121
.expect("trait ref not in def map!");
@@ -141,9 +144,14 @@ fn check_impl_of_trait(cx: &mut Context, it: &Item, trait_ref: &TraitRef, self_t
141144
match self_type.node {
142145
TyPath(_, ref bounds, path_node_id) => {
143146
assert!(bounds.is_none());
144-
let struct_def = cx.tcx.def_map.borrow().get_copy(&path_node_id);
147+
let struct_def = cx.tcx
148+
.def_map
149+
.borrow()
150+
.get_copy(&path_node_id);
145151
let struct_did = ast_util::def_id_of_def(struct_def);
146-
check_struct_safe_for_destructor(cx, self_type.span, struct_did);
152+
check_struct_safe_for_destructor(cx,
153+
self_type.span,
154+
struct_did);
147155
}
148156
_ => {
149157
cx.tcx.sess.span_bug(self_type.span,

src/librustc/middle/trans/_match.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -891,8 +891,10 @@ fn get_options(bcx: &Block, m: &[Match], col: uint) -> Vec<Opt> {
891891
// conditions over-match, we need to be careful about them. This
892892
// means that in order to properly handle things in order, we need
893893
// to not always merge conditions.
894-
fn add_veclen_to_set(set: &mut Vec<Opt> , i: uint,
895-
len: uint, vlo: VecLenOpt) {
894+
fn add_veclen_to_set(set: &mut Vec<Opt>,
895+
i: uint,
896+
len: uint,
897+
vlo: VecLenOpt) {
896898
match set.last() {
897899
// If the last condition in the list matches the one we want
898900
// to add, then extend its range. Otherwise, make a new

src/librustc/middle/typeck/astconv.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -891,10 +891,12 @@ pub fn ty_of_closure<AC:AstConv>(
891891
onceness: onceness,
892892
store: store,
893893
bounds: bounds,
894-
sig: ty::FnSig {binder_id: id,
895-
inputs: input_tys,
896-
output: output_ty,
897-
variadic: decl.variadic}
894+
sig: ty::FnSig {
895+
binder_id: id,
896+
inputs: input_tys,
897+
output: output_ty,
898+
variadic: decl.variadic,
899+
}
898900
}
899901
}
900902

src/librustc/middle/typeck/check/demand.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,11 @@ pub fn suptype_with_fn(fcx: &FnCtxt,
3737
ty_b: ty::t,
3838
handle_err: |Span, ty::t, ty::t, &ty::type_err|) {
3939
// n.b.: order of actual, expected is reversed
40-
match infer::mk_subty(fcx.infcx(), b_is_expected, infer::Misc(sp),
41-
ty_b, ty_a) {
40+
match infer::mk_subty(fcx.infcx(),
41+
b_is_expected,
42+
infer::Misc(sp),
43+
ty_b,
44+
ty_a) {
4245
result::Ok(()) => { /* ok */ }
4346
result::Err(ref err) => {
4447
handle_err(sp, ty_a, ty_b, err);
@@ -47,7 +50,11 @@ pub fn suptype_with_fn(fcx: &FnCtxt,
4750
}
4851

4952
pub fn eqtype(fcx: &FnCtxt, sp: Span, expected: ty::t, actual: ty::t) {
50-
match infer::mk_eqty(fcx.infcx(), false, infer::Misc(sp), actual, expected) {
53+
match infer::mk_eqty(fcx.infcx(),
54+
false,
55+
infer::Misc(sp),
56+
actual,
57+
expected) {
5158
Ok(()) => { /* ok */ }
5259
Err(ref err) => {
5360
fcx.report_mismatched_types(sp, expected, actual, err);

src/librustc/middle/typeck/check/mod.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,9 +2310,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
23102310
let expected_sty = unpack_expected(fcx,
23112311
expected,
23122312
|x| Some((*x).clone()));
2313-
let (expected_sig,
2314-
expected_onceness,
2315-
expected_bounds) = {
2313+
let (expected_sig, expected_onceness, expected_bounds) = {
23162314
match expected_sty {
23172315
Some(ty::ty_closure(ref cenv)) => {
23182316
let (_, sig) =
@@ -2377,8 +2375,14 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
23772375
ty::UniqTraitStore => (ast::NormalFn, expr.id)
23782376
};
23792377

2380-
check_fn(fcx.ccx, inherited_style, &fty_sig,
2381-
decl, id, body, fn_kind, fcx.inh);
2378+
check_fn(fcx.ccx,
2379+
inherited_style,
2380+
&fty_sig,
2381+
decl,
2382+
id,
2383+
body,
2384+
fn_kind,
2385+
fcx.inh);
23822386
}
23832387

23842388

@@ -3181,8 +3185,11 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
31813185
} else {
31823186
let el = ty::sequence_element_type(fcx.tcx(),
31833187
t1);
3184-
infer::mk_eqty(fcx.infcx(), false,
3185-
infer::Misc(sp), el, t2).is_ok()
3188+
infer::mk_eqty(fcx.infcx(),
3189+
false,
3190+
infer::Misc(sp),
3191+
el,
3192+
t2).is_ok()
31863193
}
31873194
}
31883195

src/librustc/middle/typeck/mod.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,10 +298,18 @@ pub fn require_same_types(tcx: &ty::ctxt,
298298
let result = match maybe_infcx {
299299
None => {
300300
let infcx = infer::new_infer_ctxt(tcx);
301-
infer::mk_eqty(&infcx, t1_is_expected, infer::Misc(span), t1, t2)
301+
infer::mk_eqty(&infcx,
302+
t1_is_expected,
303+
infer::Misc(span),
304+
t1,
305+
t2)
302306
}
303307
Some(infcx) => {
304-
infer::mk_eqty(infcx, t1_is_expected, infer::Misc(span), t1, t2)
308+
infer::mk_eqty(infcx,
309+
t1_is_expected,
310+
infer::Misc(span),
311+
t1,
312+
t2)
305313
}
306314
};
307315

src/libsyntax/ext/deriving/default.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ pub fn expand_deriving_default(cx: &mut ExtCtxt,
4545
trait_def.expand(cx, mitem, item, push)
4646
}
4747

48-
fn default_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> @Expr {
48+
fn default_substructure(cx: &mut ExtCtxt,
49+
trait_span: Span,
50+
substr: &Substructure)
51+
-> @Expr {
4952
let default_ident = vec!(
5053
cx.ident_of("std"),
5154
cx.ident_of("default"),

src/libsyntax/ext/deriving/zero.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ pub fn expand_deriving_zero(cx: &mut ExtCtxt,
6262
trait_def.expand(cx, mitem, item, push)
6363
}
6464

65-
fn zero_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> @Expr {
65+
fn zero_substructure(cx: &mut ExtCtxt,
66+
trait_span: Span,
67+
substr: &Substructure)
68+
-> @Expr {
6669
let zero_ident = vec!(
6770
cx.ident_of("std"),
6871
cx.ident_of("num"),

0 commit comments

Comments
 (0)