Closed
Description
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