mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
18 lines
334 B
Rust
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() {}
|