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

remove erroneous error message when checking impl trait params #48709

Merged
merged 2 commits into from
Apr 5, 2018

Conversation

tinaun
Copy link
Contributor

@tinaun tinaun commented Mar 3, 2018

fixes #48703

@rust-highfive
Copy link
Collaborator

r? @eddyb

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

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 3, 2018
@tinaun tinaun force-pushed the issue48703 branch 2 times, most recently from e848adf to a951343 Compare March 4, 2018 05:46
@tinaun
Copy link
Contributor Author

tinaun commented Mar 5, 2018

i don't really like my solution here, but idk if doing the test in both functions would be any better

@eddyb
Copy link
Member

eddyb commented Mar 6, 2018

r? @nikomatsakis

@rust-highfive rust-highfive assigned nikomatsakis and unassigned eddyb Mar 6, 2018
Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

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

Seems good to me, the only nit is in the name of the parameter, which could be clearer I think.

@@ -4919,7 +4919,8 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
fn check_path_parameter_count(&self,
span: Span,
segment: &mut Option<(&hir::PathSegment, &ty::Generics)>,
is_method_call: bool) {
is_method_call: bool,
is_impl_trait: bool) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: lots of bool parameters can get sorta hard to read. I like to do:

struct IsMethodCall(bool);
struct IsImplTrait(bool);

and then use those types instead of plain bool. Then the caller can do check_path_parameter_count(span, segment, IsMethodCall(true), IsImplTrait(false)) or whatever. Inside the function, you can read the value by doing is_method_call.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

But in any case I kind of think the name is_impl_trait is not very informative. How about suppress_mismatch_error or something?

@nikomatsakis nikomatsakis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 9, 2018
@nikomatsakis
Copy link
Contributor

@tinaun -- do you think you'll have a chance to address the nit above? ❤️

@tinaun tinaun force-pushed the issue48703 branch 2 times, most recently from 6e23c12 to d7dfc85 Compare March 15, 2018 00:33
@shepmaster shepmaster added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 18, 2018
@shepmaster
Copy link
Member

@nikomatsakis looks like there has been new code pushed!

@nikomatsakis
Copy link
Contributor

True, although it did not address my nit. That's ok, I don't care that much, but @tinaun you will need to fix this travis error:

https://travis-ci.org/rust-lang/rust/builds/353614751#L1817

r=me once green

@nikomatsakis nikomatsakis added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 20, 2018
@pietroalbini
Copy link
Member

@tinaun ping from triage! The travis build is failing, could you fix that so the PR can be merged?

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Apr 4, 2018

📌 Commit 97e0dc3 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 4, 2018
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Apr 5, 2018
remove erroneous error message when checking impl trait params

fixes rust-lang#48703
@bors
Copy link
Contributor

bors commented Apr 5, 2018

⌛ Testing commit 97e0dc3 with merge 290420ba65d7e5829826c9cd84d20d9a923e3138...

@alexcrichton
Copy link
Member

@bors: retry

prioritizing rollup with this included in it

@bors
Copy link
Contributor

bors commented Apr 5, 2018

⌛ Testing commit 97e0dc3 with merge 4bf76d6...

bors added a commit that referenced this pull request Apr 5, 2018
remove erroneous error message when checking impl trait params

fixes #48703
@bors
Copy link
Contributor

bors commented Apr 5, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error message when passing parameters to fn using impl Trait is ungreat
8 participants