Skip to content

Commit d0790c4

Browse files
committed
Whitespace fix again.
1 parent 15982fe commit d0790c4

File tree

14 files changed

+109
-100
lines changed

14 files changed

+109
-100
lines changed

src/librustc/infer/error_reporting/nice_region_error/named_anon_conflict.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ impl<'a, 'gcx, 'tcx> NiceRegionError<'a, 'gcx, 'tcx> {
118118
new_ty.to_string(),
119119
Applicability::Unspecified,
120120
)
121-
.span_label(span, format!("lifetime `{}` required", named))
122-
.emit();
121+
.span_label(span, format!("lifetime `{}` required", named))
122+
.emit();
123123
return Some(ErrorReported);
124124
}
125125

src/librustc/session/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -433,11 +433,11 @@ impl Session {
433433
DiagnosticBuilderMethod::SpanSuggestion(suggestion) => {
434434
let span = span_maybe.expect("span_suggestion_* needs a span");
435435
diag_builder.span_suggestion_with_applicability(
436-
span,
437-
message,
438-
suggestion,
439-
Applicability::Unspecified,
440-
);
436+
span,
437+
message,
438+
suggestion,
439+
Applicability::Unspecified,
440+
);
441441
}
442442
}
443443
}

src/librustc_borrowck/borrowck/mod.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -868,19 +868,19 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
868868
db.note(fn_closure_msg);
869869
} else {
870870
db.span_suggestion_with_applicability(
871-
sp,
872-
msg,
873-
suggestion,
874-
Applicability::Unspecified,
875-
);
871+
sp,
872+
msg,
873+
suggestion,
874+
Applicability::Unspecified,
875+
);
876876
}
877877
} else {
878878
db.span_suggestion_with_applicability(
879-
sp,
880-
msg,
881-
suggestion,
882-
Applicability::Unspecified,
883-
);
879+
sp,
880+
msg,
881+
suggestion,
882+
Applicability::Unspecified,
883+
);
884884
}
885885
}
886886
_ => {
@@ -1344,13 +1344,13 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
13441344
capture_span,
13451345
Origin::Ast)
13461346
.span_suggestion_with_applicability(
1347-
err.span,
1348-
&format!("to force the closure to take ownership of {} \
1349-
(and any other referenced variables), \
1350-
use the `move` keyword",
1351-
cmt_path_or_string),
1352-
suggestion,
1353-
Applicability::MachineApplicable,
1347+
err.span,
1348+
&format!("to force the closure to take ownership of {} \
1349+
(and any other referenced variables), \
1350+
use the `move` keyword",
1351+
cmt_path_or_string),
1352+
suggestion,
1353+
Applicability::MachineApplicable,
13541354
)
13551355
.emit();
13561356
self.signal_error();

src/librustc_errors/diagnostic.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -307,9 +307,9 @@ impl Diagnostic {
307307
suggestion: Vec<(Span, String)>,
308308
) -> &mut Self {
309309
self.multipart_suggestion_with_applicability(
310-
msg,
311-
suggestion,
312-
Applicability::Unspecified,
310+
msg,
311+
suggestion,
312+
Applicability::Unspecified,
313313
)
314314
}
315315

src/librustc_passes/loops.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,14 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
142142
"can only break with a value inside \
143143
`loop` or breakable block")
144144
.span_suggestion_with_applicability(
145-
e.span,
146-
&format!("instead, use `break` on its own \
147-
without a value inside this `{}` loop",
148-
kind.name()),
149-
"break".to_string(),
150-
Applicability::MaybeIncorrect,
145+
e.span,
146+
&format!(
147+
"instead, use `break` on its own \
148+
without a value inside this `{}` loop",
149+
kind.name()
150+
),
151+
"break".to_string(),
152+
Applicability::MaybeIncorrect,
151153
)
152154
.emit();
153155
}

src/librustc_resolve/lib.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -3300,11 +3300,11 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
33003300
"expecting a type here because of type ascription");
33013301
if line_sp != line_base_sp {
33023302
err.span_suggestion_short_with_applicability(
3303-
sp,
3304-
"did you mean to use `;` here instead?",
3305-
";".to_string(),
3306-
Applicability::MaybeIncorrect,
3307-
);
3303+
sp,
3304+
"did you mean to use `;` here instead?",
3305+
";".to_string(),
3306+
Applicability::MaybeIncorrect,
3307+
);
33083308
}
33093309
break;
33103310
} else if snippet.trim().len() != 0 {
@@ -4829,8 +4829,12 @@ fn show_candidates(err: &mut DiagnosticBuilder,
48294829
*candidate = format!("use {};\n{}", candidate, additional_newline);
48304830
}
48314831

4832-
err.span_suggestions_with_applicability(span, &msg, path_strings,
4833-
Applicability::Unspecified);
4832+
err.span_suggestions_with_applicability(
4833+
span,
4834+
&msg,
4835+
path_strings,
4836+
Applicability::Unspecified,
4837+
);
48344838
} else {
48354839
let mut msg = msg;
48364840
msg.push(':');

src/librustc_typeck/check/cast.rs

+18-15
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
299299
err.note("The type information given here is insufficient to check whether \
300300
the pointer cast is valid");
301301
if unknown_cast_to {
302-
err.span_suggestion_short_with_applicability(self.cast_span,
303-
"consider giving more type information",
304-
String::new(),
305-
Applicability::Unspecified,
306-
);
302+
err.span_suggestion_short_with_applicability(
303+
self.cast_span,
304+
"consider giving more type information",
305+
String::new(),
306+
Applicability::Unspecified,
307+
);
307308
}
308309
err.emit();
309310
}
@@ -329,11 +330,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
329330
if self.cast_ty.is_trait() {
330331
match fcx.tcx.sess.source_map().span_to_snippet(self.cast_span) {
331332
Ok(s) => {
332-
err.span_suggestion_with_applicability(self.cast_span,
333-
"try casting to a reference instead",
334-
format!("&{}{}", mtstr, s),
335-
Applicability::MachineApplicable,
336-
);
333+
err.span_suggestion_with_applicability(
334+
self.cast_span,
335+
"try casting to a reference instead",
336+
format!("&{}{}", mtstr, s),
337+
Applicability::MachineApplicable,
338+
);
337339
}
338340
Err(_) => {
339341
span_help!(err, self.cast_span, "did you mean `&{}{}`?", mtstr, tstr)
@@ -350,11 +352,12 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
350352
ty::Adt(def, ..) if def.is_box() => {
351353
match fcx.tcx.sess.source_map().span_to_snippet(self.cast_span) {
352354
Ok(s) => {
353-
err.span_suggestion_with_applicability(self.cast_span,
354-
"try casting to a `Box` instead",
355-
format!("Box<{}>", s),
356-
Applicability::MachineApplicable,
357-
);
355+
err.span_suggestion_with_applicability(
356+
self.cast_span,
357+
"try casting to a `Box` instead",
358+
format!("Box<{}>", s),
359+
Applicability::MachineApplicable,
360+
);
358361
}
359362
Err(_) => span_help!(err, self.cast_span, "did you mean `Box<{}>`?", tstr),
360363
}

src/librustc_typeck/check/demand.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
133133
let suggestions = compatible_variants.iter()
134134
.map(|v| format!("{}({})", v, expr_text)).collect::<Vec<_>>();
135135
err.span_suggestions_with_applicability(
136-
expr.span,
137-
"try using a variant of the expected type",
138-
suggestions,
139-
Applicability::MaybeIncorrect,
136+
expr.span,
137+
"try using a variant of the expected type",
138+
suggestions,
139+
Applicability::MaybeIncorrect,
140140
);
141141
}
142142
}

src/librustc_typeck/check/mod.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -3349,11 +3349,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
33493349
let msg = format!("`{}` is a native pointer; try dereferencing it", base);
33503350
let suggestion = format!("(*{}).{}", base, field);
33513351
err.span_suggestion_with_applicability(
3352-
field.span,
3353-
&msg,
3354-
suggestion,
3355-
Applicability::MaybeIncorrect,
3356-
);
3352+
field.span,
3353+
&msg,
3354+
suggestion,
3355+
Applicability::MaybeIncorrect,
3356+
);
33573357
}
33583358
_ => {}
33593359
}
@@ -4722,11 +4722,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
47224722
) {
47234723
if let Some((sp, msg, suggestion)) = self.check_ref(expr, found, expected) {
47244724
err.span_suggestion_with_applicability(
4725-
sp,
4726-
msg,
4727-
suggestion,
4728-
Applicability::MachineApplicable,
4729-
);
4725+
sp,
4726+
msg,
4727+
suggestion,
4728+
Applicability::MachineApplicable,
4729+
);
47304730
} else if !self.check_for_cast(err, expr, found, expected) {
47314731
let methods = self.get_conversion_methods(expr.span, expected, found);
47324732
if let Ok(expr_text) = self.sess().source_map().span_to_snippet(expr.span) {
@@ -4757,11 +4757,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
47574757
}) .collect::<Vec<_>>();
47584758
if !suggestions.is_empty() {
47594759
err.span_suggestions_with_applicability(
4760-
expr.span,
4761-
"try using a conversion method",
4762-
suggestions,
4763-
Applicability::MaybeIncorrect,
4764-
);
4760+
expr.span,
4761+
"try using a conversion method",
4762+
suggestions,
4763+
Applicability::MaybeIncorrect,
4764+
);
47654765
}
47664766
}
47674767
}

src/librustc_typeck/check/op.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,10 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
445445
"`+` can't be used to concatenate two `&str` strings");
446446
match source_map.span_to_snippet(lhs_expr.span) {
447447
Ok(lstring) => err.span_suggestion_with_applicability(
448-
lhs_expr.span,
449-
msg,
450-
format!("{}.to_owned()", lstring),
451-
Applicability::MachineApplicable,
448+
lhs_expr.span,
449+
msg,
450+
format!("{}.to_owned()", lstring),
451+
Applicability::MachineApplicable,
452452
),
453453
_ => err.help(msg),
454454
};
@@ -466,12 +466,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
466466
) {
467467
(Ok(l), Ok(r), false) => {
468468
err.multipart_suggestion_with_applicability(
469-
msg,
470-
vec![
471-
(lhs_expr.span, format!("{}.to_owned()", l)),
472-
(rhs_expr.span, format!("&{}", r)),
473-
],
474-
Applicability::MachineApplicable,
469+
msg,
470+
vec![
471+
(lhs_expr.span, format!("{}.to_owned()", l)),
472+
(rhs_expr.span, format!("&{}", r)),
473+
],
474+
Applicability::MachineApplicable,
475475
);
476476
}
477477
_ => {

src/libsyntax/config.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ impl<'a> StripUnconfigured<'a> {
125125
let mut err = self.sess.span_diagnostic.struct_span_err(span, msg);
126126
if !suggestion.is_empty() {
127127
err.span_suggestion_with_applicability(
128-
span,
129-
"expected syntax is",
130-
suggestion.into(),
131-
Applicability::MaybeIncorrect,
128+
span,
129+
"expected syntax is",
130+
suggestion.into(),
131+
Applicability::MaybeIncorrect,
132132
);
133133
}
134134
err.emit();

src/libsyntax/ext/tt/macro_rules.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ fn generic_extension<'cx>(cx: &'cx mut ExtCtxt,
189189
err.note("you might be missing a comma");
190190
} else {
191191
err.span_suggestion_short_with_applicability(
192-
comma_span,
193-
"missing comma here",
194-
", ".to_string(),
195-
Applicability::MachineApplicable,
192+
comma_span,
193+
"missing comma here",
194+
", ".to_string(),
195+
Applicability::MachineApplicable,
196196
);
197197
}
198198
}

src/libsyntax/parse/parser.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3883,11 +3883,11 @@ impl<'a> Parser<'a> {
38833883
// If the struct looks otherwise well formed, recover and continue.
38843884
if let Some(sp) = comma_sp {
38853885
err.span_suggestion_short_with_applicability(
3886-
sp,
3887-
"remove this comma",
3888-
String::new(),
3889-
Applicability::MachineApplicable,
3890-
);
3886+
sp,
3887+
"remove this comma",
3888+
String::new(),
3889+
Applicability::MachineApplicable,
3890+
);
38913891
}
38923892
err.emit();
38933893
break;

src/libsyntax_ext/format.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -997,9 +997,9 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt,
997997
}
998998
if suggestions.len() > 0 {
999999
diag.multipart_suggestion_with_applicability(
1000-
"format specifiers use curly braces",
1001-
suggestions,
1002-
Applicability::MachineApplicable,
1000+
"format specifiers use curly braces",
1001+
suggestions,
1002+
Applicability::MachineApplicable,
10031003
);
10041004
}
10051005
}};

0 commit comments

Comments
 (0)