为什么不能满足这种更高的kinded life相关类型特征限制?

时间:2015-12-06 04:29:44

标签: rust

trait A<'self_>: 'self_ {
    type I;
}
trait AMut
    where
        Self: for<'self_> A<'self_>,    
        for<'self_> <Self as A<'self_>>::I: 'static
{
    fn mutate_self(&mut self);      
}

fn foo<X>(x: &mut X)
    where
        X: 'static + for<'a> A<'a> + AMut,
        for<'a> <X as A<'a>>::I: 'static
{
    x.mutate_self();
}

fn main() {}

playpen link

错误
<anon>:17:7: 17:20 error: the requirement `for<'self_> <X as A<'self_>>::I : 'static` is not satisfied [E0280]
<anon>:17     x.mutate_self();
                ^~~~~~~~~~~~~
error: aborting due to previous error
playpen: application terminated with error code 101

我会认为第15行的界限会满足第7行的界限。我错过了什么?

0 个答案:

没有答案