ITADN

Infinite recursion compilation error when using KeyedSubfield

#4612Opentysen 创建于 2026-03-03
T
tysencommented
**Describe the bug** The KeyedSubfield struct previously had a struct-level bound: ``` pub struct KeyedSubfield<Inner, Prev, K, T> where for<'a> &'a T: IntoIterator, { ... } ``` This causes infinite trait resolution when used alongside, for example, bevy_ecs. The root cause is that bevy_ecs has a blanket implementation: ``` impl<'w, 's, T: Resource> IntoIterator for &Res<'w, 's, T> { ... } ``` During compilation we end up recursing infinitely checking Res<..>, Res<Res<..>>, Res<Res<Res<..>>> and so on. **To Reproduce** https://github.com/tysen/store-infinite-recursion
0 条评论