Code
fn ord() -> _ {
async || {}
}
Current output
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
--> src/lib.rs:1:13
|
1 | fn ord() -> _ {
| ^ not allowed in type signatures
|
help: replace with the correct return type
|
1 - fn ord() -> _ {
1 + fn ord() -> {async closure@src/lib.rs:2:5: 2:13} {
|
Desired output
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types
--> src/lib.rs:1:13
|
1 | fn ord() -> _ {
| ^ not allowed in type signatures
|
help: replace with the correct return type
|
1 - fn ord() -> _ {
1 + fn ord() -> impl AsyncFn() {
|
Rationale and extra context
This works correctly if you remove either async or ||.
Found from #148488.
Other cases
Rust Version
Nightly version: 1.93.0-nightly
(2025-11-03 20383c9f1d84eb9b9c66)
Anything else?
No response
Code
Current output
Desired output
Rationale and extra context
This works correctly if you remove either
asyncor||.Found from #148488.
Other cases
Rust Version
Anything else?
No response