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

E0121 suggests the use of the unique type of a generator #80844

Closed
PatchMixolydic opened this issue Jan 9, 2021 · 5 comments
Closed

E0121 suggests the use of the unique type of a generator #80844

PatchMixolydic opened this issue Jan 9, 2021 · 5 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. F-coroutines `#![feature(coroutines)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@PatchMixolydic
Copy link
Contributor

PatchMixolydic commented Jan 9, 2021

cc #80179

This still fails on generators (playground):

#![feature(generators)]

fn foo() -> _ {
    || yield 4i32
}
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> src/lib.rs:3:13
  |
3 | fn foo() -> _ {
  |             ^
  |             |
  |             not allowed in type signatures
  |             help: replace with the correct return type: [generator@src/lib.rs:4:5: 4:18 {i32, ()}]

Tested on:

cargo 1.50.0-nightly (75d5d8cff 2020-12-22)
release: 1.50.0
commit-hash: 75d5d8cffe3464631f82dcd3c470b78dc1dda8bb
commit-date: 2020-12-22

I'm working on a PR to fix this as well as making this suggestion and E0308's try adding a return type suggestion use the same mechanism for checking if a type is suggestable directly.

@rustbot claim
@rustbot modify labels: +A-diagnostics +D-invalid-suggestion +F-generators +T-compiler

@rustbot rustbot added A-diagnostics Area: Messages for errors, warnings, and lints D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. F-coroutines `#![feature(coroutines)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 9, 2021
@camelid
Copy link
Member

camelid commented Jan 9, 2021

@PatchMixolydic By the way, you don't need to open an issue if you're immediately going to open a PR.

@PatchMixolydic
Copy link
Contributor Author

PatchMixolydic commented Jan 9, 2021

My mistake 😅

@camelid
Copy link
Member

camelid commented Jan 9, 2021

Don't worry about it! It's not a problem; I was just letting you know that you shouldn't feel obliged to do it :)

@PatchMixolydic
Copy link
Contributor Author

PatchMixolydic commented Mar 20, 2021

Status update: I'm not certain I'm the right person for the job due to my warped schedule, among other things. You can find the progress I made at #80847, but note that a rebase caused important tests to fail. The commits might be usable as a basis for a new PR, but they're probably useless directly. I might come back to this when I have more time/control over my life.

@PatchMixolydic PatchMixolydic removed their assignment Mar 20, 2021
@compiler-errors
Copy link
Member

This seems to be resolved on nightly.

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 D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. F-coroutines `#![feature(coroutines)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants