Defining temporary type aliases in type expressions?

I know there is type which allows you to define a permanent type alias within a scope. Sometimes, it's nice to be able to define a type alias just temporarily for use inside a type expression, e.g.

type Output = Aug<<&'a X as Mul<&'a Y>>::Output,
                  MulNode<<&'a X as Mul<&'a Y>>::Output, &'a NX, &'a NY>>;

Notice that <&'a X as Mul<&'a Y>>::Output is repeated twice within the type expression. It'd be nice to be able to write it in a more readable manner:

type Output = Aug<R, MulNode<R, &'a NX, &'a NY>>
    where R = <&'a X as Mul<&'a Y>>::Output;

Has anyone else ran into the same annoyance?

3 Likes