在Rust回归时向上翻箱子

gan*_*an_ 5 rust

我有一个奇怪的问题:

trait A {}
trait B : A {}

struct MyStruct {}
impl A for MyStruct {}
impl B for MyStruct {}

fn fun_b() -> Box<B> {
    Box::new(MyStruct{})
}

fn fun_a() -> Box<A> {
    /*
    error: mismatched types [E0308]
    note: expected type `Box<A + 'static>`
    note:    found type `Box<B + 'static>`
    */
    fun_b()
}

fn main() {
    fun_a();
    fun_b();
}
Run Code Online (Sandbox Code Playgroud)

如果我替换fun_a为:

fn fun_a() -> Box<A> {
    Box::new(MyStruct{})
}
Run Code Online (Sandbox Code Playgroud)

(完全一样fun_b)

我需要在这里明确投射吗?为什么,更重要的是如何?