Whitespace fix again.

This commit is contained in:
Vitaly _Vi Shukela 2018-09-17 20:13:08 +03:00
parent 15982fe369
commit d0790c490a
No known key found for this signature in database
GPG key ID: C097221D6E03DF68
14 changed files with 109 additions and 100 deletions

View file

@ -143,9 +143,11 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
`loop` or breakable block") `loop` or breakable block")
.span_suggestion_with_applicability( .span_suggestion_with_applicability(
e.span, e.span,
&format!("instead, use `break` on its own \ &format!(
"instead, use `break` on its own \
without a value inside this `{}` loop", without a value inside this `{}` loop",
kind.name()), kind.name()
),
"break".to_string(), "break".to_string(),
Applicability::MaybeIncorrect, Applicability::MaybeIncorrect,
) )

View file

@ -4829,8 +4829,12 @@ fn show_candidates(err: &mut DiagnosticBuilder,
*candidate = format!("use {};\n{}", candidate, additional_newline); *candidate = format!("use {};\n{}", candidate, additional_newline);
} }
err.span_suggestions_with_applicability(span, &msg, path_strings, err.span_suggestions_with_applicability(
Applicability::Unspecified); span,
&msg,
path_strings,
Applicability::Unspecified,
);
} else { } else {
let mut msg = msg; let mut msg = msg;
msg.push(':'); msg.push(':');

View file

@ -299,7 +299,8 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
err.note("The type information given here is insufficient to check whether \ err.note("The type information given here is insufficient to check whether \
the pointer cast is valid"); the pointer cast is valid");
if unknown_cast_to { if unknown_cast_to {
err.span_suggestion_short_with_applicability(self.cast_span, err.span_suggestion_short_with_applicability(
self.cast_span,
"consider giving more type information", "consider giving more type information",
String::new(), String::new(),
Applicability::Unspecified, Applicability::Unspecified,
@ -329,7 +330,8 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
if self.cast_ty.is_trait() { if self.cast_ty.is_trait() {
match fcx.tcx.sess.source_map().span_to_snippet(self.cast_span) { match fcx.tcx.sess.source_map().span_to_snippet(self.cast_span) {
Ok(s) => { Ok(s) => {
err.span_suggestion_with_applicability(self.cast_span, err.span_suggestion_with_applicability(
self.cast_span,
"try casting to a reference instead", "try casting to a reference instead",
format!("&{}{}", mtstr, s), format!("&{}{}", mtstr, s),
Applicability::MachineApplicable, Applicability::MachineApplicable,
@ -350,7 +352,8 @@ impl<'a, 'gcx, 'tcx> CastCheck<'tcx> {
ty::Adt(def, ..) if def.is_box() => { ty::Adt(def, ..) if def.is_box() => {
match fcx.tcx.sess.source_map().span_to_snippet(self.cast_span) { match fcx.tcx.sess.source_map().span_to_snippet(self.cast_span) {
Ok(s) => { Ok(s) => {
err.span_suggestion_with_applicability(self.cast_span, err.span_suggestion_with_applicability(
self.cast_span,
"try casting to a `Box` instead", "try casting to a `Box` instead",
format!("Box<{}>", s), format!("Box<{}>", s),
Applicability::MachineApplicable, Applicability::MachineApplicable,