Auto merge of #43386 - oli-obk:suggestions, r=nikomatsakis

Adjust new suggestions to the suggestion guidelines

Addresses https://github.com/rust-lang/rust/pull/42033#discussion_r127694915

guidelines are https://github.com/rust-lang/rust/blob/master//src/librustc_errors/diagnostic.rs#L212-L224
This commit is contained in:
bors 2017-07-23 18:13:20 +00:00
commit f3e26a02eb
10 changed files with 40 additions and 64 deletions

View file

@ -2936,7 +2936,7 @@ impl<'a> Parser<'a> {
let expr_str = self.sess.codemap().span_to_snippet(expr.span)
.unwrap_or(pprust::expr_to_string(&expr));
err.span_suggestion(expr.span,
"if you want to compare the casted value then write:",
"try comparing the casted value",
format!("({})", expr_str));
err.emit();