-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
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
Given the following code: playground link
use std::net::IpAddr;
fn main() {
let addr = Into::<IpAddr>.into([127,0,0,1]);
}
The current output is:
Compiling playground v0.0.1 (/playground)
error[[E0423]](https://doc.rust-lang.org/stable/error-index.html#E0423): expected value, found trait `Into`
--> src/main.rs:3:15
|
3 | let addr = Into::<IpAddr>.into([127,0,0,1]);
| ^^^^^^^^^^^^^^ not a value
For more information about this error, try `rustc --explain E0423`.
error: could not compile `playground` due to previous error
Ideally the output should look like:
Calling associated methods on a trait is done by using ::
Try:
--> src/main.rs:3:15
|
3 | let addr = Into::<IpAddr>::into([127,0,0,1]);
| ^^^^++^^^^^
pihme and bindsdev
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.