Skip to content

Into<[type error]> in diagnostic #105138

Closed
@lylythechosenone

Description

@lylythechosenone

Given the following code:

pub enum LabelText {
    Plain,
}
impl<T> From<T> for LabelText
where
    T: Into<Cow<'static, str>>,
{
    fn from(text: T) -> Self {
        LabelText::Plain(text.into())
    }
}

The current output is:

error[E0119]: conflicting implementations of trait `core::convert::From<error::LabelText>` for type `error::LabelText`
  --> src/error.rs:40:1
   |
40 | impl<T> From<T> for LabelText
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: conflicting implementation in crate `core`:
           - impl<T> core::convert::From<T> for T;
   = note: downstream crates may implement trait `core::convert::Into<[type error]>` for type `error::LabelText`

I doubt it's supposed to be Into<[type error]>

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall 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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions