Skip to content

Commit 786b86e

Browse files
committed
rustc/middle: whitespace & formatting fixes
1 parent 96736f2 commit 786b86e

14 files changed

+534
-572
lines changed

src/librustc/middle/dead.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkSymbolVisitor<'a, 'tcx> {
210210
}
211211

212212
fn visit_variant_data(&mut self, def: &'tcx hir::VariantData, _: ast::Name,
213-
_: &hir::Generics, _: ast::NodeId, _: syntax_pos::Span) {
213+
_: &hir::Generics, _: ast::NodeId, _: syntax_pos::Span) {
214214
let has_repr_c = self.repr_has_repr_c;
215215
let inherited_pub_visibility = self.inherited_pub_visibility;
216216
let live_fields = def.fields().iter().filter(|f| {
@@ -492,8 +492,8 @@ impl<'a, 'tcx> DeadVisitor<'a, 'tcx> {
492492
ctor_id: Option<ast::NodeId>)
493493
-> bool {
494494
if self.live_symbols.contains(&id)
495-
|| ctor_id.map_or(false,
496-
|ctor| self.live_symbols.contains(&ctor)) {
495+
|| ctor_id.map_or(false, |ctor| self.live_symbols.contains(&ctor))
496+
{
497497
return true;
498498
}
499499
// If it's a type whose items are live, then it's live, too.

src/librustc/middle/dependency_format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
163163
let src = tcx.used_crate_source(cnum);
164164
if src.rlib.is_some() { continue }
165165
sess.err(&format!("crate `{}` required to be available in rlib format, \
166-
but was not found in this form",
166+
but was not found in this form",
167167
tcx.crate_name(cnum)));
168168
}
169169
return Vec::new();
@@ -247,7 +247,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
247247
_ => "dylib",
248248
};
249249
sess.err(&format!("crate `{}` required to be available in {} format, \
250-
but was not found in this form",
250+
but was not found in this form",
251251
tcx.crate_name(cnum), kind));
252252
}
253253
}

src/librustc/middle/entry.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
1211
use hir::map as hir_map;
1312
use hir::def_id::{CRATE_DEF_INDEX};
1413
use session::{config, Session};
@@ -131,7 +130,7 @@ fn find_item(item: &Item, ctxt: &mut EntryContext<'_, '_>, at_root: bool) {
131130
ctxt.attr_main_fn = Some((item.id, item.span));
132131
} else {
133132
struct_span_err!(ctxt.session, item.span, E0137,
134-
"multiple functions with a #[main] attribute")
133+
"multiple functions with a #[main] attribute")
135134
.span_label(item.span, "additional #[main] function")
136135
.span_label(ctxt.attr_main_fn.unwrap().1, "first #[main] function")
137136
.emit();
@@ -141,11 +140,8 @@ fn find_item(item: &Item, ctxt: &mut EntryContext<'_, '_>, at_root: bool) {
141140
if ctxt.start_fn.is_none() {
142141
ctxt.start_fn = Some((item.id, item.span));
143142
} else {
144-
struct_span_err!(
145-
ctxt.session, item.span, E0138,
146-
"multiple 'start' functions")
147-
.span_label(ctxt.start_fn.unwrap().1,
148-
"previous `start` function here")
143+
struct_span_err!(ctxt.session, item.span, E0138, "multiple 'start' functions")
144+
.span_label(ctxt.start_fn.unwrap().1, "previous `start` function here")
149145
.span_label(item.span, "multiple `start` functions")
150146
.emit();
151147
}

src/librustc/middle/expr_use_visitor.rs

+10-9
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
321321
region::Scope {
322322
id: body.value.hir_id.local_id,
323323
data: region::ScopeData::Node
324-
}));
324+
}));
325325
let arg_cmt = Rc::new(self.mc.cat_rvalue(
326326
arg.hir_id,
327327
arg.pat.span,
@@ -402,20 +402,20 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
402402
self.walk_expr(&subexpr)
403403
}
404404

405-
hir::ExprKind::Unary(hir::UnDeref, ref base) => { // *base
405+
hir::ExprKind::Unary(hir::UnDeref, ref base) => { // *base
406406
self.select_from_expr(&base);
407407
}
408408

409-
hir::ExprKind::Field(ref base, _) => { // base.f
409+
hir::ExprKind::Field(ref base, _) => { // base.f
410410
self.select_from_expr(&base);
411411
}
412412

413-
hir::ExprKind::Index(ref lhs, ref rhs) => { // lhs[rhs]
413+
hir::ExprKind::Index(ref lhs, ref rhs) => { // lhs[rhs]
414414
self.select_from_expr(&lhs);
415415
self.consume_expr(&rhs);
416416
}
417417

418-
hir::ExprKind::Call(ref callee, ref args) => { // callee(args)
418+
hir::ExprKind::Call(ref callee, ref args) => { // callee(args)
419419
self.walk_callee(expr, &callee);
420420
self.consume_exprs(args);
421421
}
@@ -824,12 +824,13 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
824824
cmt_discr: mc::cmt<'tcx>,
825825
pat: &hir::Pat,
826826
mode: &mut TrackMatchMode) {
827-
debug!("determine_pat_move_mode cmt_discr={:?} pat={:?}", cmt_discr,
828-
pat);
827+
debug!("determine_pat_move_mode cmt_discr={:?} pat={:?}", cmt_discr, pat);
828+
829829
return_if_err!(self.mc.cat_pattern(cmt_discr, pat, |cmt_pat, pat| {
830830
if let PatKind::Binding(..) = pat.node {
831-
let bm = *self.mc.tables.pat_binding_modes().get(pat.hir_id)
832-
.expect("missing binding mode");
831+
let bm = *self.mc.tables.pat_binding_modes()
832+
.get(pat.hir_id)
833+
.expect("missing binding mode");
833834
match bm {
834835
ty::BindByReference(..) =>
835836
mode.lub(BorrowingMatch),

src/librustc/middle/intrinsicck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<'a, 'tcx> ExprVisitor<'a, 'tcx> {
117117
};
118118

119119
struct_span_err!(self.tcx.sess, span, E0512,
120-
"transmute called with types of different sizes")
120+
"transmute called with types of different sizes")
121121
.note(&format!("source type: {} ({})", from, skeleton_string(from, sk_from)))
122122
.note(&format!("target type: {} ({})", to, skeleton_string(to, sk_to)))
123123
.emit();

src/librustc/middle/lang_items.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ macro_rules! language_item_table {
3939
$( $variant:ident, $name:expr, $method:ident; )*
4040
) => {
4141

42-
4342
enum_from_u32! {
4443
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
4544
pub enum LangItem {
@@ -161,8 +160,7 @@ impl<'a, 'tcx> LanguageItemCollector<'a, 'tcx> {
161160
name)),
162161
};
163162
if let Some(span) = self.tcx.hir.span_if_local(original_def_id) {
164-
span_note!(&mut err, span,
165-
"first defined here.");
163+
span_note!(&mut err, span, "first defined here.");
166164
} else {
167165
err.note(&format!("first defined in crate `{}`.",
168166
self.tcx.crate_name(original_def_id.krate)));

src/librustc/middle/lib_features.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ impl<'a, 'tcx> LibFeatureCollector<'a, 'tcx> {
128128
let msg = format!(
129129
"feature `{}` is declared {}, but was previously declared {}",
130130
feature,
131-
if since.is_some() { "stable"} else { "unstable" },
132-
if since.is_none() { "stable"} else { "unstable" },
131+
if since.is_some() { "stable" } else { "unstable" },
132+
if since.is_none() { "stable" } else { "unstable" },
133133
);
134134
self.tcx.sess.struct_span_err_with_code(span, &msg,
135135
DiagnosticId::Error("E0711".into())).emit();

0 commit comments

Comments
 (0)