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

Suggest adding a where-clause when that can help #32583

Merged
merged 7 commits into from
Apr 7, 2016

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Mar 29, 2016

Suggest adding a where-clause when there is an unmet trait-bound that can be satisfied if some type can implement it.

r? @nikomatsakis

@bors
Copy link
Contributor

bors commented Mar 31, 2016

☔ The latest upstream changes (presumably #32439) made this pull request unmergeable. Please resolve the merge conflicts.

@arielb1 arielb1 force-pushed the need-a-bound branch 2 times, most recently from 317e7e6 to 331e612 Compare March 31, 2016 19:43
let custom_note = report_on_unimplemented(infcx, &trait_ref.0,
obligation.cause.span);
if let Some(s) = custom_note {
"the predicate `{}` is not satisfied",
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I wonder if it is better to write in this uniform style, or to try to have a custom error message? Not clear to me. It seems likely that if we are going to make this message generic, we could combine with some other error-code -- though maybe there is value in separating out this form of predicate from the others. NM, keep it with its own code.

@nikomatsakis
Copy link
Contributor

Everything looks good, I'd like to review the comments though, just because I'd like to ensure this is well documented for future reference (and to make sure we are on same page)

@nikomatsakis
Copy link
Contributor

@arielb1

That's the impl Display for TraitRef.

Yes, I know, I was suggesting changing it to remove the space.

Ariel Ben-Yehuda and others added 5 commits April 5, 2016 20:58
now that normalize_to_error no longer creates these, it is unnecessary.
suggest adding a where-clause when there is an unmet trait-bound that
can be satisfied if some type can implement it.
the meaning of these tests had changed completely over the years and now they
are only a maintenance burden.
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 5, 2016

📌 Commit 832b707 has been approved by nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 6, 2016

⌛ Testing commit 832b707 with merge c7a6876...

@bors
Copy link
Contributor

bors commented Apr 6, 2016

💔 Test failed - auto-linux-64-opt

@arielb1
Copy link
Contributor Author

arielb1 commented Apr 6, 2016

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 6, 2016

📌 Commit 32fc7c3 has been approved by nikomatsakis

@arielb1
Copy link
Contributor Author

arielb1 commented Apr 6, 2016

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 6, 2016

📌 Commit 30d8eff has been approved by nikomatsakis

Manishearth added a commit to Manishearth/rust that referenced this pull request Apr 7, 2016
Suggest adding a where-clause when that can help

Suggest adding a where-clause when there is an unmet trait-bound that can be satisfied if some type can implement it.

r? @nikomatsakis
bors added a commit that referenced this pull request Apr 7, 2016
Rollup of 11 pull requests

- Successful merges: #32016, #32583, #32699, #32729, #32731, #32738, #32741, #32745, #32748, #32757, #32786
- Failed merges: #32773
@bors
Copy link
Contributor

bors commented Apr 7, 2016

⌛ Testing commit 30d8eff with merge a66f46e...

@bors
Copy link
Contributor

bors commented Apr 7, 2016

💔 Test failed - auto-linux-64-nopt-t

@arielb1
Copy link
Contributor Author

arielb1 commented Apr 7, 2016

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Apr 7, 2016

📌 Commit 0ac5e48 has been approved by nikomatsakis

bors added a commit that referenced this pull request Apr 7, 2016
Suggest adding a where-clause when that can help

Suggest adding a where-clause when there is an unmet trait-bound that can be satisfied if some type can implement it.

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Apr 7, 2016

⌛ Testing commit 0ac5e48 with merge 444a118...

@bors bors mentioned this pull request Apr 7, 2016
@bors bors merged commit 0ac5e48 into rust-lang:master Apr 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants