Skip to content

Commit

Permalink
Fixed some remaining whitespace issues.
Browse files Browse the repository at this point in the history
(Not sure if it is correct although).
  • Loading branch information
vi committed Sep 17, 2018
1 parent 2b77760 commit 0269e66
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions src/librustc_typeck/check/demand.rs
Expand Up @@ -132,11 +132,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
let expr_text = print::to_string(print::NO_ANN, |s| s.print_expr(expr));
let suggestions = compatible_variants.iter()
.map(|v| format!("{}({})", v, expr_text)).collect::<Vec<_>>();
err.span_suggestions_with_applicability(expr.span,
"try using a variant of the expected type",
suggestions,
Applicability::MaybeIncorrect,
);
err.span_suggestions_with_applicability(
expr.span,
"try using a variant of the expected type",
suggestions,
Applicability::MaybeIncorrect,
);
}
}

Expand Down
7 changes: 4 additions & 3 deletions src/librustc_typeck/check/method/suggest.rs
Expand Up @@ -251,15 +251,16 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
let snippet = tcx.sess.source_map().span_to_snippet(lit.span)
.unwrap_or("<numeric literal>".to_string());

err.span_suggestion_with_applicability(lit.span,
err.span_suggestion_with_applicability(
lit.span,
&format!("you must specify a concrete type for \
this numeric value, like `{}`",
concrete_type),
format!("{}_{}",
snippet,
concrete_type),
Applicability::MaybeIncorrect,
);
);
}
hir::ExprKind::Path(ref qpath) => { // local binding
if let &hir::QPath::Resolved(_, ref path) = &qpath {
Expand Down Expand Up @@ -524,7 +525,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
&msg,
path_strings,
Applicability::MaybeIncorrect,
);
);
} else {
let limit = if candidates.len() == 5 { 5 } else { 4 };
for (i, trait_did) in candidates.iter().take(limit).enumerate() {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_typeck/check/op.rs
Expand Up @@ -449,7 +449,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
msg,
format!("{}.to_owned()", lstring),
Applicability::MachineApplicable,
),
),
_ => err.help(msg),
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/config.rs
Expand Up @@ -129,7 +129,7 @@ impl<'a> StripUnconfigured<'a> {
"expected syntax is",
suggestion.into(),
Applicability::MaybeIncorrect,
);
);
}
err.emit();
true
Expand Down

0 comments on commit 0269e66

Please sign in to comment.