Skip to content

Conversation

Elliot-Roberts
Copy link
Contributor

Issue

The tests in crates/cfg/src/tests.rs depend on the tt feature of that crate, but are not feature-gated behind it.

When tests are run from the workspace root, there is no error because the workspace enables the tt feature:

cfg = { path = "./crates/cfg", version = "0.0.0", features = ["tt"] }

But there are compile errors when trying to run that specific crate's tests via cargo test --package cfg or cd crates/cfg && cargo test. This also affects running tests via the VSCode "Run Test" inlay buttons or Test Explorer panel.

Fix

In this PR, I just made tt a required dependency of cfg, removing the feature.

I looked at all the places where this cfg crate is used, and it seems everywhere inherits the dependency spec from the workspace, and so enables the tt feature.

If it turns out having tt as an optional dependency is important, I'm up for making all the tests conditionally compiled, or potentially applying a workaround to enable the tt feature when compiling tests.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2025
@ShoyuVanilla
Copy link
Member

As cfg is published in crates.io and some crates are depending on it other than rust-analyzer ones, I think dev-dependency thing would be better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants