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

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

Open
varkor opened this issue Oct 1, 2020 · 2 comments
Open
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-typesystem Area: The type system C-enhancement Category: An issue proposing an enhancement or a PR with one. D-inconsistent Diagnostics: Inconsistency in formatting, grammar or style between diagnostic messages. D-verbose Diagnostics: Too much output caused by a single piece of incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@varkor
Copy link
Member

varkor commented Oct 1, 2020

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
@varkor varkor 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. D-inconsistent Diagnostics: Inconsistency in formatting, grammar or style between diagnostic messages. labels Oct 1, 2020
@jyn514 jyn514 added D-verbose Diagnostics: Too much output caused by a single piece of incorrect code. A-typesystem Area: The type system labels Oct 1, 2020
@JohnTitor JohnTitor added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Oct 1, 2020
@reza-ebrahimi
Copy link

Just happening in Beta and Nightly channel.

@estebank
Copy link
Contributor

Triage: no change.

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 A-typesystem Area: The type system C-enhancement Category: An issue proposing an enhancement or a PR with one. D-inconsistent Diagnostics: Inconsistency in formatting, grammar or style between diagnostic messages. D-verbose Diagnostics: Too much output caused by a single piece of incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants