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 wrongly suggests replacements for _ #86021

Closed
fee1-dead opened this issue Jun 5, 2021 · 0 comments · Fixed by #86058
Closed

E0121 wrongly suggests replacements for _ #86021

fee1-dead opened this issue Jun 5, 2021 · 0 comments · Fixed by #86058
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-incorrect Diagnostics: A diagnostic that is giving misleading or incorrect information. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@fee1-dead
Copy link
Member

fee1-dead commented Jun 5, 2021

Given the following code: play

const A: [_; 3] = [1u8, 2, 3];

The current output is:

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> src/lib.rs:1:10
  |
1 | const A: [_; 3] = [1u8, 2, 3];
  |          ^^^^^^
  |          |
  |          not allowed in type signatures
  |          help: replace `_` with the correct type: `[u8; 3]`

Ideally the output should look like:

error[E0121]: the type placeholder `_` is not allowed within types on item signatures
 --> src/lib.rs:1:10
  |
1 | const A: [_; 3] = [1u8, 2, 3];
  |          ^^^^^^
  |          |
  |          not allowed in type signatures
  |          help: replace `_` with the correct type: `u8`

@rustbot claim
@rustbot label D-incorrect D-invalid-suggestion

@fee1-dead fee1-dead 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. labels Jun 5, 2021
@rustbot rustbot added D-incorrect Diagnostics: A diagnostic that is giving misleading or incorrect information. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. labels Jun 5, 2021
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Jun 6, 2021
…kh726

Remove `_`  from E0121 diagnostic suggestions

Fixes rust-lang#86021.
@bors bors closed this as completed in d7d2548 Jun 7, 2021
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-incorrect Diagnostics: A diagnostic that is giving misleading or incorrect information. D-invalid-suggestion Diagnostics: A structured suggestion resulting in incorrect code. 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.

2 participants