simplest by example:
use std::io::Error as IOError;
#[derive(Debug)]
pub enum SubSystemError<M> {
el1(i32),
el2(String),
el3(M)
}
type InstErr = SubSystemError<IOError>;
fn main() {
let v0 : SubSystemError<IOError> = SubSystemError::el1(5);
let v1 : InstErr = SubSystemError::el2(String::from("abc"));
let v2 : InstErr = InstErr::el2(7);
}
ends up with error on v2 which is illogical to me. el2 should be available by InstErr type ...
error: no associated item named `el2` found for type `SubSystemError<std::io::Error>` in the current scope
--> <anon>:17:24
|
17 | let v2 : InstErr = InstErr::el2(7);
| ^^^^^^^^^^^^
error: aborting due to previous error