Skip to content

Commit 2628f3c

Browse files
author
Jorge Aparicio
committed
fix alignment
1 parent bd71d11 commit 2628f3c

File tree

34 files changed

+464
-479
lines changed

34 files changed

+464
-479
lines changed

src/compiletest/compiletest.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ fn collect_tests_from_dir(config: &Config,
312312
} else if file_path.is_dir() {
313313
let relative_file_path = relative_dir_path.join(file.file_name());
314314
collect_tests_from_dir(config,
315-
base,
316-
&file_path,
317-
&relative_file_path,
318-
tests)?;
315+
base,
316+
&file_path,
317+
relative_file_path,
318+
tests)?;
319319
}
320320
}
321321
Ok(())

src/librustc/middle/def_id.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub struct DefId {
5656
impl fmt::Debug for DefId {
5757
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5858
write!(f, "DefId {{ krate: {:?}, node: {:?}",
59-
self.krate, self.index)?;
59+
self.krate, self.index)?;
6060

6161
// Unfortunately, there seems to be no way to attempt to print
6262
// a path for a def-id, so I'll just make a best effort for now

src/librustc/middle/infer/combine.rs

+8-10
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ pub fn super_combine_tys<'a,'tcx:'a,R>(infcx: &InferCtxt<'a, 'tcx>,
7171
// Relate integral variables to other types
7272
(&ty::TyInfer(ty::IntVar(a_id)), &ty::TyInfer(ty::IntVar(b_id))) => {
7373
infcx.int_unification_table
74-
.borrow_mut()
75-
.unify_var_var(a_id, b_id)
76-
.map_err(|e| int_unification_error(a_is_expected, e))?;
74+
.borrow_mut()
75+
.unify_var_var(a_id, b_id)
76+
.map_err(|e| int_unification_error(a_is_expected, e))?;
7777
Ok(a)
7878
}
7979
(&ty::TyInfer(ty::IntVar(v_id)), &ty::TyInt(v)) => {
@@ -92,9 +92,9 @@ pub fn super_combine_tys<'a,'tcx:'a,R>(infcx: &InferCtxt<'a, 'tcx>,
9292
// Relate floating-point variables to other types
9393
(&ty::TyInfer(ty::FloatVar(a_id)), &ty::TyInfer(ty::FloatVar(b_id))) => {
9494
infcx.float_unification_table
95-
.borrow_mut()
96-
.unify_var_var(a_id, b_id)
97-
.map_err(|e| float_unification_error(relation.a_is_expected(), e))?;
95+
.borrow_mut()
96+
.unify_var_var(a_id, b_id)
97+
.map_err(|e| float_unification_error(relation.a_is_expected(), e))?;
9898
Ok(a)
9999
}
100100
(&ty::TyInfer(ty::FloatVar(v_id)), &ty::TyFloat(v)) => {
@@ -123,8 +123,7 @@ fn unify_integral_variable<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
123123
val: ty::IntVarValue)
124124
-> RelateResult<'tcx, Ty<'tcx>>
125125
{
126-
infcx
127-
.int_unification_table
126+
infcx.int_unification_table
128127
.borrow_mut()
129128
.unify_var_value(vid, val)
130129
.map_err(|e| int_unification_error(vid_is_expected, e))?;
@@ -140,8 +139,7 @@ fn unify_float_variable<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
140139
val: ast::FloatTy)
141140
-> RelateResult<'tcx, Ty<'tcx>>
142141
{
143-
infcx
144-
.float_unification_table
142+
infcx.float_unification_table
145143
.borrow_mut()
146144
.unify_var_value(vid, val)
147145
.map_err(|e| float_unification_error(vid_is_expected, e))?;

src/librustc/middle/infer/sub.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Sub<'a, 'tcx> {
7676
}
7777
(&ty::TyInfer(TyVar(a_id)), _) => {
7878
self.fields
79-
.switch_expected()
80-
.instantiate(b, SupertypeOf, a_id)?;
79+
.switch_expected()
80+
.instantiate(b, SupertypeOf, a_id)?;
8181
Ok(a)
8282
}
8383
(_, &ty::TyInfer(TyVar(b_id))) => {

src/librustc/middle/traits/select.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1038,15 +1038,15 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
10381038

10391039
// For other types, we'll use the builtin rules.
10401040
self.assemble_builtin_bound_candidates(ty::BoundCopy,
1041-
obligation,
1042-
&mut candidates)?;
1041+
obligation,
1042+
&mut candidates)?;
10431043
}
10441044
Some(bound @ ty::BoundSized) => {
10451045
// Sized is never implementable by end-users, it is
10461046
// always automatically computed.
10471047
self.assemble_builtin_bound_candidates(bound,
1048-
obligation,
1049-
&mut candidates)?;
1048+
obligation,
1049+
&mut candidates)?;
10501050
}
10511051

10521052
None if self.tcx().lang_items.unsize_trait() ==
@@ -2422,8 +2422,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
24222422
.map_bound(|(trait_ref, _)| trait_ref);
24232423

24242424
self.confirm_poly_trait_refs(obligation.cause.clone(),
2425-
obligation.predicate.to_poly_trait_ref(),
2426-
trait_ref)?;
2425+
obligation.predicate.to_poly_trait_ref(),
2426+
trait_ref)?;
24272427
Ok(self_ty)
24282428
}
24292429

@@ -2450,8 +2450,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
24502450
obligations);
24512451

24522452
self.confirm_poly_trait_refs(obligation.cause.clone(),
2453-
obligation.predicate.to_poly_trait_ref(),
2454-
trait_ref)?;
2453+
obligation.predicate.to_poly_trait_ref(),
2454+
trait_ref)?;
24552455

24562456
Ok(VtableClosureData {
24572457
closure_def_id: closure_def_id,

src/librustc/middle/ty/relate.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ pub fn relate_substs<'a,'tcx:'a,R>(relation: &mut R,
167167
let b_regions = b.get_slice(space);
168168
let r_variances = variances.map(|v| v.regions.get_slice(space));
169169
let regions = relate_region_params(relation,
170-
r_variances,
171-
a_regions,
172-
b_regions)?;
170+
r_variances,
171+
a_regions,
172+
b_regions)?;
173173
substs.mut_regions().replace(space, regions);
174174
}
175175
}
@@ -261,8 +261,8 @@ impl<'a,'tcx:'a> Relate<'a,'tcx> for ty::FnSig<'tcx> {
261261
}
262262

263263
let inputs = relate_arg_vecs(relation,
264-
&a.inputs,
265-
&b.inputs)?;
264+
&a.inputs,
265+
&b.inputs)?;
266266

267267
let output = match (a.output, b.output) {
268268
(ty::FnConverging(a_ty), ty::FnConverging(b_ty)) =>
@@ -557,8 +557,8 @@ pub fn super_relate_tys<'a,'tcx:'a,R>(relation: &mut R,
557557
{
558558
if as_.len() == bs.len() {
559559
let ts = as_.iter().zip(bs)
560-
.map(|(a, b)| relation.relate(a, b))
561-
.collect::<Result<_, _>>()?;
560+
.map(|(a, b)| relation.relate(a, b))
561+
.collect::<Result<_, _>>()?;
562562
Ok(tcx.mk_tup(ts))
563563
} else if !(as_.is_empty() || bs.is_empty()) {
564564
Err(TypeError::TupleSize(

src/librustc/mir/repr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,8 @@ impl<'tcx> Debug for Rvalue<'tcx> {
809809
let variant_def = &adt_def.variants[variant];
810810

811811
ppaux::parameterized(fmt, substs, variant_def.did,
812-
ppaux::Ns::Value, &[],
813-
|tcx| {
812+
ppaux::Ns::Value, &[],
813+
|tcx| {
814814
tcx.lookup_item_type(variant_def.did).generics
815815
})?;
816816

src/librustc/util/ppaux.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ pub fn parameterized<GG>(f: &mut fmt::Formatter,
123123
for projection in projections {
124124
start_or_continue(f, "<", ", ")?;
125125
write!(f, "{}={}",
126-
projection.projection_ty.item_name,
127-
projection.ty)?;
126+
projection.projection_ty.item_name,
127+
projection.ty)?;
128128
}
129129
return start_or_continue(f, "", ">");
130130
}
@@ -201,8 +201,8 @@ pub fn parameterized<GG>(f: &mut fmt::Formatter,
201201
for projection in projections {
202202
start_or_continue(f, "<", ", ")?;
203203
write!(f, "{}={}",
204-
projection.projection_ty.item_name,
205-
projection.ty)?;
204+
projection.projection_ty.item_name,
205+
projection.ty)?;
206206
}
207207

208208
start_or_continue(f, "", ">")?;
@@ -865,7 +865,7 @@ impl<'tcx> fmt::Display for ty::TypeVariants<'tcx> {
865865

866866
write!(f, "{} {{", bare_fn.sig.0)?;
867867
parameterized(f, substs, def_id, Ns::Value, &[],
868-
|tcx| tcx.lookup_item_type(def_id).generics)?;
868+
|tcx| tcx.lookup_item_type(def_id).generics)?;
869869
write!(f, "}}")
870870
}
871871
TyFnPtr(ref bare_fn) => {

src/librustc_back/target/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ impl Target {
468468
let mut contents = Vec::new();
469469
f.read_to_end(&mut contents).map_err(|e| e.to_string())?;
470470
let obj = json::from_reader(&mut &contents[..])
471-
.map_err(|e| e.to_string())?;
471+
.map_err(|e| e.to_string())?;
472472
Ok(Target::from_json(obj))
473473
}
474474

src/librustc_borrowck/borrowck/mir/graphviz.rs

+21-21
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,15 @@ impl<'c, 'b:'c, 'a:'b, 'tcx:'a> dot::Labeller<'c> for Graph<'c,'b,'a,'tcx> {
124124
write!(w, "</td><td></td><td></td></tr>")?;
125125
}
126126
write!(w, "<tr><td></td><td {bg} {align}>{objs:?}",
127-
bg = BG_FLOWCONTENT,
128-
align = ALIGN_RIGHT,
129-
objs = c)?;
127+
bg = BG_FLOWCONTENT,
128+
align = ALIGN_RIGHT,
129+
objs = c)?;
130130
seen_one = true;
131131
}
132132
if !seen_one {
133133
write!(w, "<tr><td></td><td {bg} {align}>[]",
134-
bg = BG_FLOWCONTENT,
135-
align = ALIGN_RIGHT)?;
134+
bg = BG_FLOWCONTENT,
135+
align = ALIGN_RIGHT)?;
136136
}
137137
Ok(())
138138
}
@@ -155,38 +155,38 @@ impl<'c, 'b:'c, 'a:'b, 'tcx:'a> dot::Labeller<'c> for Graph<'c,'b,'a,'tcx> {
155155
let kill = flow.interpret_set(flow.sets.kill_set_for(i));
156156
chunked_present_left(w, &gen[..], chunk_size)?;
157157
write!(w, " = GEN:</td><td {bg}><FONT {face}>{genbits:?}</FONT></td>\
158-
<td></td></tr>",
159-
bg = BG_FLOWCONTENT,
160-
face = FACE_MONOSPACE,
161-
genbits=bits_to_string( flow.sets.gen_set_for(i),
162-
flow.sets.bytes_per_block()))?;
158+
<td></td></tr>",
159+
bg = BG_FLOWCONTENT,
160+
face = FACE_MONOSPACE,
161+
genbits=bits_to_string( flow.sets.gen_set_for(i),
162+
flow.sets.bytes_per_block()))?;
163163
write!(w, "<tr><td></td><td {bg} {align}>KILL:</td>\
164-
<td {bg}><FONT {face}>{killbits:?}</FONT></td>",
165-
bg = BG_FLOWCONTENT,
166-
align = ALIGN_RIGHT,
167-
face = FACE_MONOSPACE,
168-
killbits=bits_to_string(flow.sets.kill_set_for(i),
169-
flow.sets.bytes_per_block()))?;
164+
<td {bg}><FONT {face}>{killbits:?}</FONT></td>",
165+
bg = BG_FLOWCONTENT,
166+
align = ALIGN_RIGHT,
167+
face = FACE_MONOSPACE,
168+
killbits=bits_to_string(flow.sets.kill_set_for(i),
169+
flow.sets.bytes_per_block()))?;
170170

171171
// (chunked_present_right)
172172
let mut seen_one = false;
173173
for k in kill.chunks(chunk_size) {
174174
if !seen_one {
175175
// continuation of row; this is fourth <td>
176176
write!(w, "<td {bg}>= {kill:?}</td></tr>",
177-
bg = BG_FLOWCONTENT,
178-
kill=k)?;
177+
bg = BG_FLOWCONTENT,
178+
kill=k)?;
179179
} else {
180180
// new row, with indent of three <td>'s
181181
write!(w, "<tr><td></td><td></td><td></td><td {bg}>{kill:?}</td></tr>",
182-
bg = BG_FLOWCONTENT,
183-
kill=k)?;
182+
bg = BG_FLOWCONTENT,
183+
kill=k)?;
184184
}
185185
seen_one = true;
186186
}
187187
if !seen_one {
188188
write!(w, "<td {bg}>= []</td></tr>",
189-
bg = BG_FLOWCONTENT)?;
189+
bg = BG_FLOWCONTENT)?;
190190
}
191191

192192
Ok(())

src/librustc_driver/driver.rs

+16-16
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ pub fn compile_input(sess: &Session,
100100
let outputs = build_output_filenames(input, outdir, output, &krate.attrs, sess);
101101
let id = link::find_crate_name(Some(sess), &krate.attrs, input);
102102
let expanded_crate = phase_2_configure_and_expand(sess,
103-
&cstore,
104-
krate,
105-
&id[..],
106-
addl_plugins)?;
103+
&cstore,
104+
krate,
105+
&id[..],
106+
addl_plugins)?;
107107

108108
(outputs, expanded_crate, id)
109109
};
@@ -169,12 +169,12 @@ pub fn compile_input(sess: &Session,
169169
};
170170

171171
phase_3_run_analysis_passes(sess,
172-
&cstore,
173-
hir_map,
174-
&arenas,
175-
&id,
176-
control.make_glob_map,
177-
|tcx, mir_map, analysis, result| {
172+
&cstore,
173+
hir_map,
174+
&arenas,
175+
&id,
176+
control.make_glob_map,
177+
|tcx, mir_map, analysis, result| {
178178
{
179179
// Eventually, we will want to track plugins.
180180
let _ignore = tcx.dep_graph.in_ignore();
@@ -683,8 +683,8 @@ pub fn phase_2_configure_and_expand(sess: &Session,
683683
})?;
684684

685685
time(time_passes,
686-
"const fn bodies and arguments",
687-
|| const_fn::check_crate(sess, &krate))?;
686+
"const fn bodies and arguments",
687+
|| const_fn::check_crate(sess, &krate))?;
688688

689689
if sess.opts.debugging_opts.input_stats {
690690
println!("Post-expansion node count: {}", count_nodes(&krate));
@@ -781,10 +781,10 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
781781
};
782782

783783
let named_region_map = time(time_passes,
784-
"lifetime resolution",
785-
|| middle::resolve_lifetime::krate(sess,
786-
&hir_map,
787-
&def_map.borrow()))?;
784+
"lifetime resolution",
785+
|| middle::resolve_lifetime::krate(sess,
786+
&hir_map,
787+
&def_map.borrow()))?;
788788

789789
time(time_passes,
790790
"looking for entry point",

0 commit comments

Comments
 (0)