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

Invalid E0404 throw #66736

Closed
GuillaumeGomez opened this issue Nov 25, 2019 · 1 comment · Fixed by #83062
Closed

Invalid E0404 throw #66736

GuillaumeGomez opened this issue Nov 25, 2019 · 1 comment · Fixed by #83062
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-parser Area: The parsing of Rust source code to an AST. C-enhancement Category: An issue proposing an enhancement or a PR with one. D-confusing Diagnostics: Confusing error or lint that should be reworked. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics

Comments

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Nov 25, 2019

This code:

let x: i8 += 14;

gives the following error:

error[E0404]: expected trait, found builtin type `i8`
 --> src/main.rs:5:12
  |
5 |     let x: i8 += 14;
  |            ^^ not a trait

warning: trait objects without an explicit `dyn` are deprecated
 --> src/main.rs:5:12
  |
5 |     let x: i8 += 14;
  |            ^^^^ help: use `dyn`: `dyn i8 +`
  |
  = note: `#[warn(bare_trait_objects)]` on by default

error: aborting due to previous error

It's not clear or even close to what the actual problem is. I think it should throw the E0067 error code.

This issue has been assigned to @mibac138 via this comment.

@GuillaumeGomez GuillaumeGomez added A-diagnostics Area: Messages for errors, warnings, and lints WG-diagnostics Working group: Diagnostics D-confusing Diagnostics: Confusing error or lint that should be reworked. labels Nov 25, 2019
@jonas-schievink jonas-schievink added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 25, 2019
@estebank estebank added the A-parser Area: The parsing of Rust source code to an AST. label Nov 25, 2019
@mibac138
Copy link
Contributor

mibac138 commented May 6, 2020

@rustbot claim

@rustbot rustbot self-assigned this May 6, 2020
Manishearth added a commit to Manishearth/rust that referenced this issue Jun 16, 2020
Improve diagnostics for `let x += 1`

Fixes(?) rust-lang#66736

The code responsible for the `E0404` errors is [here](https://github.com/rust-lang/rust/blob/master/src/librustc_parse/parser/ty.rs#L399-L424) which I don't think can be easily modified to prevent emitting an error in one specific case. Because of this I couldn't get rid of `E0404` and instead added `E0067` along with a help message which will fix the problem.

r? @estebank
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jun 17, 2020
Improve diagnostics for `let x += 1`

Fixes(?) rust-lang#66736

The code responsible for the `E0404` errors is [here](https://github.com/rust-lang/rust/blob/master/src/librustc_parse/parser/ty.rs#L399-L424) which I don't think can be easily modified to prevent emitting an error in one specific case. Because of this I couldn't get rid of `E0404` and instead added `E0067` along with a help message which will fix the problem.

r? @estebank
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Jun 17, 2020
Improve diagnostics for `let x += 1`

Fixes(?) rust-lang#66736

The code responsible for the `E0404` errors is [here](https://github.com/rust-lang/rust/blob/master/src/librustc_parse/parser/ty.rs#L399-L424) which I don't think can be easily modified to prevent emitting an error in one specific case. Because of this I couldn't get rid of `E0404` and instead added `E0067` along with a help message which will fix the problem.

r? @estebank
tmandry added a commit to tmandry/rust that referenced this issue Jun 17, 2020
Improve diagnostics for `let x += 1`

Fixes(?) rust-lang#66736

The code responsible for the `E0404` errors is [here](https://github.com/rust-lang/rust/blob/master/src/librustc_parse/parser/ty.rs#L399-L424) which I don't think can be easily modified to prevent emitting an error in one specific case. Because of this I couldn't get rid of `E0404` and instead added `E0067` along with a help message which will fix the problem.

r? @estebank
Manishearth added a commit to Manishearth/rust that referenced this issue Jun 18, 2020
Improve diagnostics for `let x += 1`

Fixes(?) rust-lang#66736

The code responsible for the `E0404` errors is [here](https://github.com/rust-lang/rust/blob/master/src/librustc_parse/parser/ty.rs#L399-L424) which I don't think can be easily modified to prevent emitting an error in one specific case. Because of this I couldn't get rid of `E0404` and instead added `E0067` along with a help message which will fix the problem.

r? @estebank
Manishearth added a commit to Manishearth/rust that referenced this issue Jun 18, 2020
Improve diagnostics for `let x += 1`

Fixes(?) rust-lang#66736

The code responsible for the `E0404` errors is [here](https://github.com/rust-lang/rust/blob/master/src/librustc_parse/parser/ty.rs#L399-L424) which I don't think can be easily modified to prevent emitting an error in one specific case. Because of this I couldn't get rid of `E0404` and instead added `E0067` along with a help message which will fix the problem.

r? @estebank
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 14, 2021
…avidtwco

Improve the wording for the `can't reassign` error

Follow-up for rust-lang#71976 (comment).
Fixes rust-lang#66736
@bors bors closed this as completed in d6eaea1 Mar 15, 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 A-parser Area: The parsing of Rust source code to an AST. C-enhancement Category: An issue proposing an enhancement or a PR with one. D-confusing Diagnostics: Confusing error or lint that should be reworked. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-diagnostics Working group: Diagnostics
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants