2017-10-22 10:14:53 -05:00
|
|
|
// Ref: https://stackoverflow.com/q/37347311
|
|
|
|
|
|
|
|
trait Storage {
|
|
|
|
type Error;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum MyError<S: Storage> {
|
|
|
|
StorageProblem(S::Error),
|
|
|
|
}
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
impl<S: Storage> From<S::Error> for MyError<S> { //~ ERROR conflicting implementations
|
2017-10-22 10:14:53 -05:00
|
|
|
fn from(error: S::Error) -> MyError<S> {
|
|
|
|
MyError::StorageProblem(error)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-20 06:13:27 -06:00
|
|
|
fn main() {}
|