Suggest type param when encountering _ in item signatures#67597
Merged
bors merged 8 commits intorust-lang:masterfrom Dec 31, 2019
Merged
Suggest type param when encountering _ in item signatures#67597bors merged 8 commits intorust-lang:masterfrom
_ in item signatures#67597bors merged 8 commits intorust-lang:masterfrom
Conversation
Contributor
|
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
estebank
commented
Dec 24, 2019
oli-obk
reviewed
Dec 24, 2019
oli-obk
reviewed
Dec 24, 2019
oli-obk
reviewed
Dec 24, 2019
oli-obk
reviewed
Dec 24, 2019
oli-obk
reviewed
Dec 24, 2019
Centril
reviewed
Dec 25, 2019
src/test/ui/error-codes/E0121.stderr
Outdated
Contributor
There was a problem hiding this comment.
was better before imo -- more obvious
This comment has been minimized.
This comment has been minimized.
Member
|
r? @oli-obk |
af2338d to
1c07fcc
Compare
This comment has been minimized.
This comment has been minimized.
1c07fcc to
859fc20
Compare
This comment has been minimized.
This comment has been minimized.
estebank
commented
Dec 27, 2019
estebank
commented
Dec 27, 2019
859fc20 to
4b4a132
Compare
oli-obk
requested changes
Dec 27, 2019
b3df95e to
63f3488
Compare
Contributor
Author
|
done |
oli-obk
reviewed
Dec 28, 2019
oli-obk
reviewed
Dec 28, 2019
oli-obk
reviewed
Dec 28, 2019
Contributor
|
r=me with the comments resolved |
63f3488 to
d3f79fc
Compare
Contributor
Author
|
@bors r=oli-obk |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
When encountering `_` type placeholder in fn arguments and return type, suggest using generic type parameters. Expand what counts as an inferable return type to slice, array and tuples of `_`.
d3f79fc to
261b606
Compare
Contributor
Author
|
@bors r=oli-obk |
Collaborator
|
📌 Commit 261b606 has been approved by |
Collaborator
bors
added a commit
that referenced
this pull request
Dec 31, 2019
Suggest type param when encountering `_` in item signatures Fix #27435.
Collaborator
|
☀️ Test successful - checks-azure |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jan 10, 2020
Extend support of `_` in type parameters
- Account for `impl Trait<_>`.
- Provide a reasonable `Span` for empty `Generics` in `impl`s.
- Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
- Fix rust-lang#67995. Follow up to rust-lang#67597.
Centril
added a commit
to Centril/rust
that referenced
this pull request
Jan 10, 2020
Extend support of `_` in type parameters
- Account for `impl Trait<_>`.
- Provide a reasonable `Span` for empty `Generics` in `impl`s.
- Account for `fn foo<_>(_: _) {}` to suggest `fn foo<T>(_: T) {}`.
- Fix rust-lang#67995. Follow up to rust-lang#67597.
This was referenced Feb 13, 2020
Dylan-DPC-zz
pushed a commit
to Dylan-DPC-zz/rust
that referenced
this pull request
Feb 28, 2020
Account for bounds and asociated items when denying `_` Fix rust-lang#68801, rust-lang#69204. Follow up to rust-lang#67597 and rust-lang#68071. Output for the original ICE report: ``` Checking vinoteca v5.0.0 (/Users/ekuber/workspace/vinoteca) error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> src/producers.rs:43:70 | 43 | pub fn top<Table: diesel::Table + diesel::query_dsl::InternalJoinDsl<_, diesel::query_source::joins::Inner, _>>(table: Table, limit: usize, connection: DbConn) -> RestResult<Vec<TopWineType>> { | ^ not allowed in type signatures ^ not allowed in type signatures error: aborting due to previous error ```
bors
added a commit
that referenced
this pull request
Feb 28, 2020
Account for bounds and asociated items when denying `_` Fix #68801, #69204. Follow up to #67597 and #68071. Output for the original ICE report: ``` Checking vinoteca v5.0.0 (/Users/ekuber/workspace/vinoteca) error[E0121]: the type placeholder `_` is not allowed within types on item signatures --> src/producers.rs:43:70 | 43 | pub fn top<Table: diesel::Table + diesel::query_dsl::InternalJoinDsl<_, diesel::query_source::joins::Inner, _>>(table: Table, limit: usize, connection: DbConn) -> RestResult<Vec<TopWineType>> { | ^ not allowed in type signatures ^ not allowed in type signatures error: aborting due to previous error ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #27435.