-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Code
fn main() {
let v = "hello" as bool;
}
Current output
error[E0606]: casting `&'static str` as `bool` is invalid
--> src/lib.rs:2:13
|
2 | let v = "hello" as bool;
| ^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0606`.
Desired output
error[E0606]: casting `&'static str` as `bool` is invalid
--> src/lib.rs:2:13
|
2 | let v = "hello" as bool;
| ^^^^^^^^^^^^^^^
help: to find out if a &str or String contains something or not, use: `!"hello".is_empty()`
For more information about this error, try `rustc --explain E0606`.
Rationale and extra context
No response
Other cases
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.