3 ms·
With what I described, bar would not compile, because the compiler would add a "+ Leak" bound to T. The unfortunate part is that means that upgrading foo to th
by thayne 3y ago
With what I described, bar would not compile, because the compiler would add a "+ Leak" bound to T.
The unfortunate part is that means that upgrading foo to the 2024 edition means you either have to break backwards compatibility (at least for 2021 code) or add Leak bounds to type parameters and trait objects. There could be a cargo fix rule to do that update for you.
It is really unfortunate that existing APIs can't be made more general without breaking compatibility though.