Fix style according to review comments.
This commit is contained in:
parent
f395072c4d
commit
6ebb9161ea
6 changed files with 36 additions and 20 deletions
|
@ -432,8 +432,12 @@ impl Session {
|
|||
}
|
||||
DiagnosticBuilderMethod::SpanSuggestion(suggestion) => {
|
||||
let span = span_maybe.expect("span_suggestion_* needs a span");
|
||||
diag_builder.span_suggestion_with_applicability(span, message, suggestion,
|
||||
Applicability::Unspecified);
|
||||
diag_builder.span_suggestion_with_applicability(
|
||||
span,
|
||||
message,
|
||||
suggestion,
|
||||
Applicability::Unspecified,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -868,11 +868,19 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
|
|||
db.note(fn_closure_msg);
|
||||
} else {
|
||||
db.span_suggestion_with_applicability(
|
||||
sp, msg, suggestion, Applicability::Unspecified);
|
||||
sp,
|
||||
msg,
|
||||
suggestion,
|
||||
Applicability::Unspecified,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
db.span_suggestion_with_applicability(
|
||||
sp, msg, suggestion, Applicability::Unspecified);
|
||||
sp,
|
||||
msg,
|
||||
suggestion,
|
||||
Applicability::Unspecified,
|
||||
);
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
|
@ -1330,7 +1338,8 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> {
|
|||
&cmt_path_or_string,
|
||||
capture_span,
|
||||
Origin::Ast)
|
||||
.span_suggestion_with_applicability(err.span,
|
||||
.span_suggestion_with_applicability(
|
||||
err.span,
|
||||
&format!("to force the closure to take ownership of {} \
|
||||
(and any other referenced variables), \
|
||||
use the `move` keyword",
|
||||
|
|
|
@ -309,7 +309,7 @@ impl Diagnostic {
|
|||
self.multipart_suggestion_with_applicability(
|
||||
msg,
|
||||
suggestion,
|
||||
Applicability::Unspecified
|
||||
Applicability::Unspecified,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -172,7 +172,8 @@ impl<'a> DiagnosticBuilder<'a> {
|
|||
-> &mut Self);
|
||||
|
||||
#[deprecated(note = "Use `span_suggestion_short_with_applicability`")]
|
||||
forward!(pub fn span_suggestion_short(&mut self,
|
||||
forward!(pub fn span_suggestion_short(
|
||||
&mut self,
|
||||
sp: Span,
|
||||
msg: &str,
|
||||
suggestion: String)
|
||||
|
|
|
@ -141,7 +141,8 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
|
|||
.span_label(e.span,
|
||||
"can only break with a value inside \
|
||||
`loop` or breakable block")
|
||||
.span_suggestion_with_applicability(e.span,
|
||||
.span_suggestion_with_applicability(
|
||||
e.span,
|
||||
&format!("instead, use `break` on its own \
|
||||
without a value inside this `{}` loop",
|
||||
kind.name()),
|
||||
|
|
|
@ -3299,7 +3299,8 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
|
|||
err.span_label(base_span,
|
||||
"expecting a type here because of type ascription");
|
||||
if line_sp != line_base_sp {
|
||||
err.span_suggestion_short_with_applicability(sp,
|
||||
err.span_suggestion_short_with_applicability(
|
||||
sp,
|
||||
"did you mean to use `;` here instead?",
|
||||
";".to_string(),
|
||||
Applicability::Unspecified,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue