-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add feature requirement info to image loading docs #13712
Add feature requirement info to image loading docs #13712
Conversation
48a1791
to
842a06e
Compare
842a06e
to
4cc0c0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally really like it! Shouldn't we use module-level feature gates for e.g. ktx.rs
?
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
I added the breaking change label because some enum variants of |
ktx2 module already has feature gate, but rust compiler isn't smart enough to mark all inner items of module with feature mark, that's why I marked explicitly |
Oh? That's surprising to me. What happens if it's ommitted? Do you have any references to bugs etc for this? |
Before my commit there already was attribute on ktx2 module and functions were not marked in docs. Now if attribute on module exists, but for function it was removed, then there is no mark in doc, if attribute on function exists, but for module it was removed, then mark in doc for function exists. I assumed that higher level attribute could reduce binary size, that is why i kept them both.
I didn't see any related issue earlier, and I didn't find it now. I just reacted to compiller behaviour. If I made an incorrect changes, I'm open to any corrections. |
Sounds good :) I'll file something for the rustdoc team reporting this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand why logging versus a compiler error is preferred given this seems to be a bug but this is certainly an improvement in user feedback either way.
Objective
Solution
Testing
ran reproducing example from issue #13468 and saw in logs
WARN bevy_render::texture::image: feature "exr" is not enabled
generated docs with command
RUSTDOCFLAGS="-Zunstable-options --cfg=docsrs" cargo +nightly doc --workspace --all-features --no-deps --document-private-items --open
and sawthat docs contain
Available on crate feature <image format> only.
marksMigration Guide
Image format related entities are feature gated, if there are compilation errors about unknown names there are some of features in list (
exr
,hdr
,basis-universal
,png
,dds
,tga
,jpeg
,bmp
,ktx2
,webp
andpnm
) should be added.