- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.9k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-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: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d2a32fe1f3460b6583534eb53d045165
fn foo() {
    let _ = "foo".into::<Option<_>>();
}The current output is:
Compiling playground v0.0.1 (/playground)
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
   --> src/lib.rs:2:19
    |
2   |     let _ = "foo".into::<Option<_>>();
    |                   ^^^^------------- help: remove these generics
    |                   |
    |                   expected 0 generic arguments
    |
note: associated function defined here, with 0 generic parameters
For more information about this error, try `rustc --explain E0107`.
error: could not compile `playground` due to previous error
Ideally the output should look like:
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
   --> src/lib.rs:2:19
    |
2   |     let _ = "foo".into::<Option<_>>();
    |                   ^^^^------------- help: remove these generics
    |                   |
    |                   expected 0 generic arguments
    |
note: associated function defined here, with 0 generic parameters
help: `Into` trait takes 1 generic argument, try annotating that instead: `Into::<Option<_>>::into("foo")
When a user called into() with an annotation, it's helpful to suggest T::from(_) too.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-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.