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

Into<[type error]> in diagnostic #105138

Closed
lylythechosenone opened this issue Dec 1, 2022 · 2 comments · Fixed by #105181
Closed

Into<[type error]> in diagnostic #105138

lylythechosenone opened this issue Dec 1, 2022 · 2 comments · Fixed by #105181
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@lylythechosenone
Copy link

lylythechosenone commented Dec 1, 2022

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]>

@lylythechosenone lylythechosenone added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 1, 2022
@compiler-errors compiler-errors added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Dec 1, 2022
@compiler-errors
Copy link
Member

We can just skip adding this note if the type references error

@bhbs
Copy link
Contributor

bhbs commented Dec 1, 2022

@rustbot claim

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 E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants