You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I, in a library, use Texture<'a> and a user of my library enables the unsafe_textures feature flag on sdl2, then the code in the library no longer compiles, because the changes (the difference between having unsafe_textures enabled or disabled) are not SemVer compatible.
I suggest making a new struct, that wraps Texture<'static> (or the contents of it) and provides unsafe methods to use it (unsafe because it is not known if the pointer is still valid), could even be without feature flag to allow using both, where needed. (I did not test this, so this idea to fix this might not be entirely accurate)
The text was updated successfully, but these errors were encountered:
Reference on feature flags: https://doc.rust-lang.org/cargo/reference/features.html#feature-unification
If I, in a library, use
Texture<'a>
and a user of my library enables theunsafe_textures
feature flag onsdl2
, then the code in the library no longer compiles, because the changes (the difference between havingunsafe_textures
enabled or disabled) are not SemVer compatible.I suggest making a new struct, that wraps
Texture<'static>
(or the contents of it) and provides unsafe methods to use it (unsafe because it is not known if the pointer is still valid), could even be without feature flag to allow using both, where needed. (I did not test this, so this idea to fix this might not be entirely accurate)The text was updated successfully, but these errors were encountered: