Skip to content

fix: Only apply cfg(test) for local crates #12599

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

Merged
merged 3 commits into from
Jun 20, 2022

Conversation

flodiebold
Copy link
Member

Don't analyze dependencies with test; this should fix various cases where crates use cfg(not(test)) and so we didn't find things.

"Local" here currently means anything that's not from the registry, so anything inside the workspace, but also path dependencies. So this isn't perfect, and users might still need to use rust-analyzer.cargo.unsetTest for these in some cases.

Don't analyze dependencies with `test`; this should fix various cases
where crates use `cfg(not(test))` and so we didn't find things.

"Local" here currently means anything that's not from the registry, so
anything inside the workspace, but also path dependencies. So this isn't
perfect, and users might still need to use
`rust-analyzer.cargo.unsetTest` for these in some cases.
@flodiebold
Copy link
Member Author

Fixes #12450

@flodiebold flodiebold changed the title Only apply cfg(test) for local crates fix: Only apply cfg(test) for local crates Jun 20, 2022
@flodiebold
Copy link
Member Author

@bors r+

@bors
Copy link
Contributor

bors commented Jun 20, 2022

📌 Commit 07d78b6 has been approved by flodiebold

@bors
Copy link
Contributor

bors commented Jun 20, 2022

⌛ Testing commit 07d78b6 with merge 312ac83...

@bors
Copy link
Contributor

bors commented Jun 20, 2022

☀️ Test successful - checks-actions
Approved by: flodiebold
Pushing 312ac83 to master...

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.

3 participants