rust/tests/ui/error-codes/e0119/so-37347311.rs
2023-01-11 09:32:08 +00:00

18 lines
334 B
Rust

// Ref: https://stackoverflow.com/q/37347311
trait Storage {
type Error;
}
enum MyError<S: Storage> {
StorageProblem(S::Error),
}
impl<S: Storage> From<S::Error> for MyError<S> { //~ ERROR conflicting implementations
fn from(error: S::Error) -> MyError<S> {
MyError::StorageProblem(error)
}
}
fn main() {}