-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust new suggestions to the suggestion guidelines #43386
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@@ -118,7 +118,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { | |||
let suggestions = compatible_variants.iter() | |||
.map(|v| format!("{}({})", v, expr_text)).collect::<Vec<_>>(); | |||
err.span_suggestions(expr.span, | |||
"perhaps you meant to use a variant of the expected type", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry 😰
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those guidelines only exist in master since a few days, everything's good!
| ---------- ^ --------- interpreted as generic arguments | ||
| | | | ||
| | not interpreted as comparison | ||
| help: try comparing the casted value: `(a as usize)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, changing the message string somehow changes formatting? Is it length dependent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@@ -6,11 +6,11 @@ error[E0308]: mismatched types | |||
| | |||
= note: expected type `()` | |||
found type `usize` | |||
help: did you mean to add a semicolon here? | |||
help: try adding a semicolon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like a :
is missing here...
help: try adding a semicolon:
|
19 | foo();
| ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or does that look funny? The double :
(after help
, and again at the end) is a bit odd I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Anyway, that's orthogonal from this PR, I know. cc @estebank )
@bors r+ |
📌 Commit 401ab61 has been approved by |
Adjust new suggestions to the suggestion guidelines Addresses #42033 (comment) guidelines are https://github.com/rust-lang/rust/blob/master//src/librustc_errors/diagnostic.rs#L212-L224
☀️ Test successful - status-appveyor, status-travis |
Addresses #42033 (comment)
guidelines are https://github.com/rust-lang/rust/blob/master//src/librustc_errors/diagnostic.rs#L212-L224