Skip to content

Make Cargo features work in isolation - #30

Closed
faysou wants to merge 1 commit into
aacebo:masterfrom
faysou:fix-isolated-features
Closed

faysou wants to merge 1 commit into
aacebo:masterfrom
faysou:fix-isolated-features

Conversation

@faysou

@faysou faysou commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Enable the dependencies that ast, fmt, template, proc-macro2, and quote need when enabled without default features. Add a CI job that checks each public feature on its own.

All twelve individual feature checks pass locally.

Related to #25.

With `default-features = false`, the dependency
`moxy = { features = ["ast", "quote"] }` failed to compile with
"unresolved import `moxy_token`": `quote` and `proc-macro2` enabled
`moxy-token` features only through a weak dependency
(`moxy-token?/quote`), which does not enable the optional `moxy-token`
dependency itself, while the root crate re-exports `moxy_token::quoted`.
Likewise `template` compiled alone, but the code `template!` generates
names `::moxy::token`, which then does not exist.

`ast`, `template`, `proc-macro2`, and `quote` now enable `token`, and
`fmt` enables `ast`, as the README's feature table already states. A CI
job checks `cargo check -p moxy --no-default-features --features <f>`
for each feature alone, since the test job builds with all features.
@faysou
faysou force-pushed the fix-isolated-features branch from df41cec to 3701c00 Compare November 21, 2026 07:02
@faysou faysou closed this Nov 21, 2026
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