Skip to content

Suggest dereferencing on E0277 if appropriate #67571

Closed
@estebank

Description

@estebank
error[E0277]: the trait bound `syntax_pos::MultiSpan: std::convert::From<&syntax_pos::span_encoding::Span>` is not satisfied
   --> src/librustc_typeck/astconv.rs:726:42
    |
726 | ...                   tcx.sess.delay_span_bug(visitor.0.iter().next().unwrap(), "asdf");
    |                                ^^^^^^^^^^^^^^ the trait `std::convert::From<&syntax_pos::span_encoding::Span>` is not implemented for `syntax_pos::MultiSpan`
    |
    = help: the following implementations were found:
              <syntax_pos::MultiSpan as std::convert::From<std::vec::Vec<syntax_pos::span_encoding::Span>>>
              <syntax_pos::MultiSpan as std::convert::From<syntax_pos::span_encoding::Span>>
    = note: required because of the requirements on the impl of `std::convert::Into<syntax_pos::MultiSpan>` for `&syntax_pos::span_encoding::Span`

Suggest *foo when <&foo as &Foo>, Into<Bar> is expected and Bar: From<Foo> is implemented.

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