Skip to content
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

Merged
merged 1 commit into from
Jul 23, 2017

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jul 21, 2017

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@shepmaster shepmaster added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 21, 2017
@@ -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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry 😰

Copy link
Contributor Author

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)`
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

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();
   |      ^

Copy link
Contributor

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.

Copy link
Contributor

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 )

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jul 23, 2017

📌 Commit 401ab61 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Jul 23, 2017

⌛ Testing commit 401ab61 with merge f3e26a0...

bors added a commit that referenced this pull request Jul 23, 2017
@bors
Copy link
Contributor

bors commented Jul 23, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: nikomatsakis
Pushing f3e26a0 to master...

@bors bors merged commit 401ab61 into rust-lang:master Jul 23, 2017
@oli-obk oli-obk deleted the suggestions branch July 23, 2017 22:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants