Skip to content

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

Closed
@estebank

Description

@estebank

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions