-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Consider suggesting RPIT for -> _
functions returning iterators
#106096
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
scottmcm
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Dec 23, 2022
|
estebank
added a commit
to estebank/rust
that referenced
this issue
Dec 27, 2022
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 28, 2022
…piler-errors Suggest `impl Iterator` when possible for `_` return type Address rust-lang#106096.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 28, 2022
…piler-errors Suggest `impl Iterator` when possible for `_` return type Address rust-lang#106096.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 28, 2022
…piler-errors Suggest `impl Iterator` when possible for `_` return type Address rust-lang#106096.
I think this is basically completed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given the following code: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c36b48aedbf2651c7b2cfc4fc42e1070
The current output is:
Ideally the output should look like:
Inspired by https://users.rust-lang.org/t/idiomatic-alternative-to-writing-a-function-that-returns-an-iterator/86391?u=scottmcm, where I went to do my usual "just say
-> _
and the compiler will tell you!" only to find that it doesn't work here -- presumably because of the Voldemort type.I don't know if there's a more general version of this, but maybe special casing
-> impl Iterator<Item = …>
would be worth doing as a particularly important case of RPIT. Maybe-> impl Future<Output = …>
too?The text was updated successfully, but these errors were encountered: