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

First step toward implementing impl Trait in argument position #44866

Merged
merged 2 commits into from
Sep 29, 2017
Merged

First step toward implementing impl Trait in argument position #44866

merged 2 commits into from
Sep 29, 2017

Conversation

mdevlamynck
Copy link
Contributor

First step implementing #44721.

Add a flag to hir and ty TypeParameterDef and raise an error when using
explicit type parameters when calling a function using impl Trait in
argument position.

I don't know if there is a procedure to add an error code so I just took an available code. Is that ok ?

r? @nikomatsakis

Add a flag to hir and ty TypeParameterDef and raise an error when using
explicit type parameters when calling a function using impl Trait in
argument position.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@arielb1 arielb1 added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 26, 2017
@@ -4677,4 +4677,6 @@ register_diagnostics! {
E0592, // duplicate definitions with name `{}`
// E0613, // Removed (merged with E0609)
E0627, // yield statement outside of generator literal
E0631, // cannot provide explicit type parameters when `impl Trait` is used in
Copy link
Contributor

Choose a reason for hiding this comment

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

This error code got taken in the meanwhile, you should pick a different one to avoid an error:

[00:03:50] tidy error: duplicate error code: 631
[00:03:50] tidy error: /checkout/src/librustc/diagnostics.rs:2057:     E0631, // type mismatch in closure arguments
[00:03:50] tidy error: /checkout/src/librustc_typeck/diagnostics.rs:4680:     E0631, // cannot provide explicit type parameters when `impl Trait` is used in
[00:03:51] some tidy checks failed

@arielb1
Copy link
Contributor

arielb1 commented Sep 26, 2017

otherwise, r? @eddyb

@arielb1 arielb1 assigned eddyb and unassigned nikomatsakis Sep 26, 2017
@eddyb
Copy link
Member

eddyb commented Sep 26, 2017

I'm not sure how I feel about the attribute, but at least it's prefixed with rustc_.
@bors r+

@bors
Copy link
Contributor

bors commented Sep 26, 2017

📌 Commit 838105f has been approved by eddyb

@mdevlamynck
Copy link
Contributor Author

@eddyb It might be worth using a more precise and explicit name like rustc_synthetic_impl_trait or something. I'm a bit uneasy about this naming.

@bors
Copy link
Contributor

bors commented Sep 29, 2017

⌛ Testing commit 838105f with merge 51cd061...

bors added a commit that referenced this pull request Sep 29, 2017
First step toward implementing impl Trait in argument position

First step implementing #44721.

Add a flag to hir and ty TypeParameterDef and raise an error when using
explicit type parameters when calling a function using impl Trait in
argument position.

I don't know if there is a procedure to add an error code so I just took an available code. Is that ok ?

r? @nikomatsakis
@bors
Copy link
Contributor

bors commented Sep 29, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing 51cd061 to master...

@bors bors merged commit 838105f into rust-lang:master Sep 29, 2017
petrochenkov added a commit to petrochenkov/rust that referenced this pull request Nov 18, 2021
This function parameter attribute was introduced in rust-lang#44866 as an intermediate step in implementing `impl Trait`, it's not necessary or used anywhere by itself.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 18, 2021
rustc: Remove `#[rustc_synthetic]`

This function parameter attribute was introduced in rust-lang#44866 as an intermediate step in implementing `impl Trait`, it's not necessary or used anywhere by itself.

Noticed while reviewing rust-lang#90947.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Nov 18, 2021
rustc: Remove `#[rustc_synthetic]`

This function parameter attribute was introduced in rust-lang#44866 as an intermediate step in implementing `impl Trait`, it's not necessary or used anywhere by itself.

Noticed while reviewing rust-lang#90947.
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Nov 22, 2021
This function parameter attribute was introduced in rust-lang/rust#44866 as an intermediate step in implementing `impl Trait`, it's not necessary or used anywhere by itself.
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.

6 participants