Variant cannot be accessed by type name when typ'ing an enum


#1

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

#2

This looks like something that should have an issue filed about it, given https://github.com/rust-lang/rust/issues/4508 and https://github.com/rust-lang/rust/issues/11047.