True, I hadn't considered this. A mutably-generic collection would also be unable to interact with other always-immutable arguments to the function. Previously, I was thinking any immutable-only function body would work, but now I can see that's not that case.
Still, I think it could be worthwhile, obviously just for the cases which still work given this restriction.
Maybe that's not the right word then. Certainly, being able to pass-through mutability is the goal here, whatever that's called.
This is interesting. Not as neat as syntax-level support, but would be even more versatile. It's kind of a shame we already have so many FooRef
/FooMut
-type trait pairs... although maybe you could unify such pairs, as needed, using a similar family pattern?