1
Fork 0

fix alignment

This commit is contained in:
Jorge Aparicio 2016-03-22 17:58:45 -05:00
parent bd71d11a8f
commit 2628f3cc8f
34 changed files with 458 additions and 473 deletions

View file

@ -314,7 +314,7 @@ fn collect_tests_from_dir(config: &Config,
collect_tests_from_dir(config, collect_tests_from_dir(config,
base, base,
&file_path, &file_path,
&relative_file_path, relative_file_path,
tests)?; tests)?;
} }
} }

View file

@ -123,8 +123,7 @@ fn unify_integral_variable<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
val: ty::IntVarValue) val: ty::IntVarValue)
-> RelateResult<'tcx, Ty<'tcx>> -> RelateResult<'tcx, Ty<'tcx>>
{ {
infcx infcx.int_unification_table
.int_unification_table
.borrow_mut() .borrow_mut()
.unify_var_value(vid, val) .unify_var_value(vid, val)
.map_err(|e| int_unification_error(vid_is_expected, e))?; .map_err(|e| int_unification_error(vid_is_expected, e))?;
@ -140,8 +139,7 @@ fn unify_float_variable<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
val: ast::FloatTy) val: ast::FloatTy)
-> RelateResult<'tcx, Ty<'tcx>> -> RelateResult<'tcx, Ty<'tcx>>
{ {
infcx infcx.float_unification_table
.float_unification_table
.borrow_mut() .borrow_mut()
.unify_var_value(vid, val) .unify_var_value(vid, val)
.map_err(|e| float_unification_error(vid_is_expected, e))?; .map_err(|e| float_unification_error(vid_is_expected, e))?;

View file

@ -469,8 +469,7 @@ fn iterate_over_potentially_unsafe_regions_in_type<'a, 'b, 'tcx>(
ty::TyTuple(ref tys) | ty::TyTuple(ref tys) |
ty::TyClosure(_, box ty::ClosureSubsts { upvar_tys: ref tys, .. }) => { ty::TyClosure(_, box ty::ClosureSubsts { upvar_tys: ref tys, .. }) => {
for ty in tys { for ty in tys {
iterate_over_potentially_unsafe_regions_in_type( iterate_over_potentially_unsafe_regions_in_type(cx, context, ty, depth+1)?
cx, context, ty, depth+1)?
} }
Ok(()) Ok(())
} }

View file

@ -354,17 +354,13 @@ pub fn check_crate(tcx: &TyCtxt, trait_map: ty::TraitMap) -> CompileResult {
coherence::check_coherence(&ccx)); coherence::check_coherence(&ccx));
})?; })?;
time(time_passes, "wf checking", || time(time_passes, "wf checking", || check::check_wf_new(&ccx))?;
check::check_wf_new(&ccx))?;
time(time_passes, "item-types checking", || time(time_passes, "item-types checking", || check::check_item_types(&ccx))?;
check::check_item_types(&ccx))?;
time(time_passes, "item-bodies checking", || time(time_passes, "item-bodies checking", || check::check_item_bodies(&ccx))?;
check::check_item_bodies(&ccx))?;
time(time_passes, "drop-impl checking", || time(time_passes, "drop-impl checking", || check::check_drop_impls(&ccx))?;
check::check_drop_impls(&ccx))?;
check_for_entry_fn(&ccx); check_for_entry_fn(&ccx);

View file

@ -508,8 +508,7 @@ impl fmt::Display for clean::Type {
primitive_link(f, clean::Slice, primitive_link(f, clean::Slice,
&format!("&amp;{}{}[{}]", lt, m, **bt)), &format!("&amp;{}{}[{}]", lt, m, **bt)),
_ => { _ => {
primitive_link(f, clean::Slice, primitive_link(f, clean::Slice, &format!("&amp;{}{}[", lt, m))?;
&format!("&amp;{}{}[", lt, m))?;
write!(f, "{}", **bt)?; write!(f, "{}", **bt)?;
primitive_link(f, clean::Slice, "]") primitive_link(f, clean::Slice, "]")
} }

View file

@ -180,8 +180,7 @@ fn doit(sess: &parse::ParseSess, mut lexer: lexer::StringReader,
if klass == "" { if klass == "" {
write!(out, "{}", Escape(&snip))?; write!(out, "{}", Escape(&snip))?;
} else { } else {
write!(out, "<span class='{}'>{}</span>", klass, write!(out, "<span class='{}'>{}</span>", klass, Escape(&snip))?;
Escape(&snip))?;
} }
} }

View file

@ -1739,8 +1739,7 @@ fn item_module(w: &mut fmt::Formatter, cx: &Context,
<td class='docblock short'> <td class='docblock short'>
{stab_docs} {docs} {stab_docs} {docs}
</td> </td>
</tr> </tr>",
",
name = *myitem.name.as_ref().unwrap(), name = *myitem.name.as_ref().unwrap(),
stab_docs = stab_docs, stab_docs = stab_docs,
docs = shorter(Some(&Markdown(doc_value).to_string())), docs = shorter(Some(&Markdown(doc_value).to_string())),

View file

@ -3612,7 +3612,8 @@ impl<'a> Parser<'a> {
let path = ident_to_path(ident_span, ident); let path = ident_to_path(ident_span, ident);
self.bump(); self.bump();
let delim = self.expect_open_delim()?; let delim = self.expect_open_delim()?;
let tts = self.parse_seq_to_end(&token::CloseDelim(delim), let tts = self.parse_seq_to_end(
&token::CloseDelim(delim),
SeqSep::none(), |p| p.parse_token_tree())?; SeqSep::none(), |p| p.parse_token_tree())?;
let mac = Mac_ { path: path, tts: tts, ctxt: EMPTY_CTXT }; let mac = Mac_ { path: path, tts: tts, ctxt: EMPTY_CTXT };
pat = PatKind::Mac(codemap::Spanned {node: mac, pat = PatKind::Mac(codemap::Spanned {node: mac,

View file

@ -1058,8 +1058,7 @@ impl<'a> State<'a> {
self.end() // end the outer fn box self.end() // end the outer fn box
} }
ast::ForeignItemKind::Static(ref t, m) => { ast::ForeignItemKind::Static(ref t, m) => {
self.head(&visibility_qualified(item.vis, self.head(&visibility_qualified(item.vis, "static"))?;
"static"))?;
if m { if m {
self.word_space("mut")?; self.word_space("mut")?;
} }
@ -1119,8 +1118,7 @@ impl<'a> State<'a> {
self.ann.pre(self, NodeItem(item))?; self.ann.pre(self, NodeItem(item))?;
match item.node { match item.node {
ast::ItemKind::ExternCrate(ref optional_path) => { ast::ItemKind::ExternCrate(ref optional_path) => {
self.head(&visibility_qualified(item.vis, self.head(&visibility_qualified(item.vis, "extern crate"))?;
"extern crate"))?;
if let Some(p) = *optional_path { if let Some(p) = *optional_path {
let val = p.as_str(); let val = p.as_str();
if val.contains("-") { if val.contains("-") {
@ -1138,16 +1136,14 @@ impl<'a> State<'a> {
self.end()?; // end outer head-block self.end()?; // end outer head-block
} }
ast::ItemKind::Use(ref vp) => { ast::ItemKind::Use(ref vp) => {
self.head(&visibility_qualified(item.vis, self.head(&visibility_qualified(item.vis, "use"))?;
"use"))?;
self.print_view_path(&vp)?; self.print_view_path(&vp)?;
word(&mut self.s, ";")?; word(&mut self.s, ";")?;
self.end()?; // end inner head-block self.end()?; // end inner head-block
self.end()?; // end outer head-block self.end()?; // end outer head-block
} }
ast::ItemKind::Static(ref ty, m, ref expr) => { ast::ItemKind::Static(ref ty, m, ref expr) => {
self.head(&visibility_qualified(item.vis, self.head(&visibility_qualified(item.vis, "static"))?;
"static"))?;
if m == ast::Mutability::Mutable { if m == ast::Mutability::Mutable {
self.word_space("mut")?; self.word_space("mut")?;
} }
@ -1163,8 +1159,7 @@ impl<'a> State<'a> {
self.end()?; // end the outer cbox self.end()?; // end the outer cbox
} }
ast::ItemKind::Const(ref ty, ref expr) => { ast::ItemKind::Const(ref ty, ref expr) => {
self.head(&visibility_qualified(item.vis, self.head(&visibility_qualified(item.vis, "const"))?;
"const"))?;
self.print_ident(item.ident)?; self.print_ident(item.ident)?;
self.word_space(":")?; self.word_space(":")?;
self.print_type(&ty)?; self.print_type(&ty)?;
@ -1192,8 +1187,7 @@ impl<'a> State<'a> {
self.print_block_with_attrs(&body, &item.attrs)?; self.print_block_with_attrs(&body, &item.attrs)?;
} }
ast::ItemKind::Mod(ref _mod) => { ast::ItemKind::Mod(ref _mod) => {
self.head(&visibility_qualified(item.vis, self.head(&visibility_qualified(item.vis, "mod"))?;
"mod"))?;
self.print_ident(item.ident)?; self.print_ident(item.ident)?;
self.nbsp()?; self.nbsp()?;
self.bopen()?; self.bopen()?;