Skip to content

Duplicate E0121 errors are emitted for placeholder types _ in some positions #77428

Open
@varkor

Description

@varkor
type FOO = fn()  -> _;

fn main() {}

produces (playground link):

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> src/main.rs:1:21
  |
1 | type FOO = fn()  -> _;
  |                     ^
  |                     |
  |                     not allowed in type signatures
  |                     help: use type parameters instead: `T`

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> src/main.rs:1:21
  |
1 | type FOO = fn()  -> _;
  |                     ^ not allowed in type signatures

error: aborting due to 2 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-type-systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-inconsistentDiagnostics: Inconsistency in formatting, grammar or style between diagnostic messages.D-verboseDiagnostics: Too much output caused by a single piece of incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions