]> git.lizzy.rs Git - rust.git/blob - tests/ui/trait-bounds/impl-bound-with-references-error.rs
Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomez
[rust.git] / tests / ui / trait-bounds / impl-bound-with-references-error.rs
1 // Regression test for #105138.
2 // This test ensures that the compiler does not add note
3 // for implementation of trait whose inner type is erroneous.
4
5 pub enum LabelText {
6     Plain,
7 }
8
9 impl<T> From<T> for LabelText
10 //~^ ERROR conflicting implementations of trait `From<LabelText>` for type `LabelText` [E0119]
11 where
12     T: Into<Cow<'static, str>>,
13     //~^ ERROR cannot find type `Cow` in this scope [E0412]
14 {
15     fn from(text: T) -> Self {
16         LabelText::Plain(text.into())
17     }
18 }
19
20 fn main() {}