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() {}
错误
<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行的界限。我错过了什么?