Skip to content

[api] Gate the experimental shape() free function#406

Merged
behdad merged 1 commit into
mainfrom
gate-experimental-shape-fn
Jul 3, 2026
Merged

[api] Gate the experimental shape() free function#406
behdad merged 1 commit into
mainfrom
gate-experimental-shape-fn

Conversation

@behdad

@behdad behdad commented Jul 3, 2026

Copy link
Copy Markdown
Member

Small follow-up spotted during the 0.12.0 publish verification.

The harfrust::shape free function is re-exported only under the
experimental_font_api feature (lib.rs):

#[cfg(feature = "experimental_font_api")]
pub use hb::face::shape;

…but its definition in hb/face.rs was not gated. In a default-feature build
the re-export is compiled out while the function remains, so it is unreachable
and warns as dead code — which surfaces during cargo publish verification
(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

  • Default build: the dead_code warning is gone.
  • --features experimental_font_api: compiles, API intact.
  • cargo test -p harfrust: 6027 passed.
  • cargo fmt --check clean.

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>
@behdad
behdad merged commit 92d5853 into main Jul 3, 2026
3 checks passed
@behdad
behdad deleted the gate-experimental-shape-fn branch July 3, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant