Closed
Description
I think the suggestion is trying to suggest a type, but gets a TyKind::Error
due to the type error in the body of the const
. Ideally we would just not suggest a type, but there are probably a lot of other places that this issue occurs.
const FOO = "hello" + 1;
Errors:
Compiling playground v0.0.1 (/playground)
error[E0369]: cannot add `{integer}` to `&str`
--> src/lib.rs:1:21
|
1 | const FOO = "hello" + 1;
| ------- ^ - {integer}
| |
| &str
error: missing type for `const` item
--> src/lib.rs:1:7
|
1 | const FOO = "hello" + 1;
| ^^^ help: provide a type for the item: `FOO: [type error]`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0369`.
error: could not compile `playground`.
To learn more, run the command again with --verbose.
Metadata
Metadata
Assignees
Labels
Area: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: A structured suggestion resulting in incorrect code.Diagnostics: An error or lint that needs small tweaks.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.