[api] Gate the experimental shape() free function#406
Merged
Conversation
The `harfrust::shape` free function is re-exported only under the `experimental_font_api` feature (it takes a `FontInstance`, which is public only under that feature), but its definition was not gated to match. In a default-feature build the re-export is compiled out while the function remains, leaving it unreachable and triggering a dead_code warning (visible during `cargo publish` verification). Gate the definition with the same `#[cfg(feature = "experimental_font_api")]`. No functional change; the experimental API is unaffected and there is no cascade -- its helpers stay reachable through other paths. Assisted-by: Claude <noreply@anthropic.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small follow-up spotted during the 0.12.0 publish verification.
The
harfrust::shapefree function is re-exported only under theexperimental_font_apifeature (lib.rs):…but its definition in
hb/face.rswas not gated. In a default-feature buildthe re-export is compiled out while the function remains, so it is unreachable
and warns as dead code — which surfaces during
cargo publishverification(that builds with default features).
Gate the definition with the same
#[cfg(feature = "experimental_font_api")].No functional change; the experimental API is unchanged, and there is no
cascade (its helpers stay reachable via other paths).
Testing
--features experimental_font_api: compiles, API intact.cargo test -p harfrust: 6027 passed.cargo fmt --checkclean.