Skip to content

Commit 6ebb916

Browse files
committed
Fix style according to review comments.
1 parent f395072 commit 6ebb916

File tree

6 files changed

+36
-20
lines changed

6 files changed

+36
-20
lines changed

src/librustc/session/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,8 +432,12 @@ impl Session {
432432
}
433433
DiagnosticBuilderMethod::SpanSuggestion(suggestion) => {
434434
let span = span_maybe.expect("span_suggestion_* needs a span");
435-
diag_builder.span_suggestion_with_applicability(span, message, suggestion,
436-
Applicability::Unspecified);
435+
diag_builder.span_suggestion_with_applicability(
436+
span,
437+
message,
438+
suggestion,
439+
Applicability::Unspecified,
440+
);
437441
}
438442
}
439443
}

src/librustc_borrowck/borrowck/mod.rs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -868,11 +868,19 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
868868
db.note(fn_closure_msg);
869869
} else {
870870
db.span_suggestion_with_applicability(
871-
sp, msg, suggestion, Applicability::Unspecified);
871+
sp,
872+
msg,
873+
suggestion,
874+
Applicability::Unspecified,
875+
);
872876
}
873877
} else {
874878
db.span_suggestion_with_applicability(
875-
sp, msg, suggestion, Applicability::Unspecified);
879+
sp,
880+
msg,
881+
suggestion,
882+
Applicability::Unspecified,
883+
);
876884
}
877885
}
878886
_ => {
@@ -1330,13 +1338,14 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
13301338
&cmt_path_or_string,
13311339
capture_span,
13321340
Origin::Ast)
1333-
.span_suggestion_with_applicability(err.span,
1334-
&format!("to force the closure to take ownership of {} \
1335-
(and any other referenced variables), \
1336-
use the `move` keyword",
1337-
cmt_path_or_string),
1338-
suggestion,
1339-
Applicability::Unspecified,
1341+
.span_suggestion_with_applicability(
1342+
err.span,
1343+
&format!("to force the closure to take ownership of {} \
1344+
(and any other referenced variables), \
1345+
use the `move` keyword",
1346+
cmt_path_or_string),
1347+
suggestion,
1348+
Applicability::Unspecified,
13401349
)
13411350
.emit();
13421351
self.signal_error();

src/librustc_errors/diagnostic.rs

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

316316
/// Prints out a message with multiple suggested edits of the code.

src/librustc_errors/diagnostic_builder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ impl<'a> DiagnosticBuilder<'a> {
172172
-> &mut Self);
173173

174174
#[deprecated(note = "Use `span_suggestion_short_with_applicability`")]
175-
forward!(pub fn span_suggestion_short(&mut self,
176-
sp: Span,
177-
msg: &str,
175+
forward!(pub fn span_suggestion_short(
176+
&mut self,
177+
sp: Span,
178+
msg: &str,
178179
suggestion: String)
179180
-> &mut Self);
180181

src/librustc_passes/loops.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
141141
.span_label(e.span,
142142
"can only break with a value inside \
143143
`loop` or breakable block")
144-
.span_suggestion_with_applicability(e.span,
144+
.span_suggestion_with_applicability(
145+
e.span,
145146
&format!("instead, use `break` on its own \
146147
without a value inside this `{}` loop",
147148
kind.name()),

src/librustc_resolve/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3299,7 +3299,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
32993299
err.span_label(base_span,
33003300
"expecting a type here because of type ascription");
33013301
if line_sp != line_base_sp {
3302-
err.span_suggestion_short_with_applicability(sp,
3302+
err.span_suggestion_short_with_applicability(
3303+
sp,
33033304
"did you mean to use `;` here instead?",
33043305
";".to_string(),
33053306
Applicability::Unspecified,

0 commit comments

Comments
 (0)