mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +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() {}
|