rust/tests/ui/wf/conflicting-impls.rs

21 lines
348 B
Rust
Raw Permalink Normal View History

2024-04-09 05:19:48 -05:00
//@ edition: 2021
struct Ty;
impl TryFrom<Ty> for u8 {
type Error = Ty;
fn try_from(_: Ty) -> Result<Self, Self::Error> {
loop {}
}
}
impl TryFrom<Ty> for u8 {
//~^ ERROR conflicting implementations of trait
type Error = Ty;
fn try_from(_: Ty) -> Result<Self, Self::Error> {
loop {}
}
}
fn main() {}