Skip to content

Invalid E0404 throw #66736

Closed
Closed

Description

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-parserArea: The parsing of Rust source code to an ASTC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-diagnosticsWorking group: Diagnostics

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions