-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
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.
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. |
src/librustc_typeck/diagnostics.rs
Outdated
@@ -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 |
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.
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
otherwise, r? @eddyb |
I'm not sure how I feel about the attribute, but at least it's prefixed with |
📌 Commit 838105f has been approved by |
@eddyb It might be worth using a more precise and explicit name like |
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
☀️ Test successful - status-appveyor, status-travis |
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.
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.
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.
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.
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