rust/tests/ui/error-codes/e0119/so-37347311.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
334 B
Rust
Raw Normal View History

// 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
fn from(error: S::Error) -> MyError<S> {
MyError::StorageProblem(error)
}
}
2017-11-20 06:13:27 -06:00
fn main() {}