Is there a builtin trait (or can we define a trait) AsT<X, Y> where the condition is that Rc<X> as Rc<Y> compiles.
pub trait AsT<X, Y> {
my_as(x: Rc<X>) -> Rc<Y> {
x as Rc<Y>
}
}
so I want this AsT to be for all pairs where the code compiles
This code compiles only if Y = dyn Trait and X: Trait. You can implement AsT for each trait you need separately.
This definitely answers the question I asked but not the question I intended to ask. 
I think part of the problem here is that under this system, I need to manually enumerate all possible pairs <X, Y.>, whereas I was hoping this information could somehow be auto derived on demand.