Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggest removing .into() for argument that already accepts Into<_> #52837

Closed
estebank opened this issue Jul 29, 2018 · 1 comment
Closed

Suggest removing .into() for argument that already accepts Into<_> #52837

estebank opened this issue Jul 29, 2018 · 1 comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

When calling a method bar that takes an argument Into<Foo> with bar(foo.into()), the type system can't figure out the type for the argument. Suggest removing the .into() call.

error[E0283]: type annotations required: cannot resolve `_: std::convert::Into<syntax_pos::MultiSpan>`
  --> libsyntax_ext/concat.rs:80:26
   |
80 |         let mut err = cx.struct_span_err(
   |                          ^^^^^^^^^^^^^^^
81 |             b_pos.into(),
   |                  ------- help: remove this call
@estebank estebank added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-diagnostics Area: Messages for errors, warnings, and lints labels Jul 29, 2018
@estebank estebank added A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 20, 2019
@estebank
Copy link
Contributor Author

estebank commented Mar 7, 2024

Fixed by #121100

@estebank estebank closed this as completed Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix` C-enhancement Category: An issue proposing an enhancement or a PR with one. D-papercut Diagnostics: An error or lint that needs small tweaks. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant