Skip to content
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

feat: Provide an config option to not set cfg(test) #18085

Merged
merged 2 commits into from
Sep 30, 2024

Conversation

ChayimFriedman2
Copy link
Contributor

Fixes #17957.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 9, 2024
ChayimFriedman2 added a commit to ChayimFriedman2/rust-analyzer that referenced this pull request Sep 10, 2024
This is a small change, but it was the cause of 90% of the errors in `rust-analyzer diagnostics .` 🫢

With this change and rust-lang#18085 together, all remaining errors are type errors.

This may mean we can enable more errors, but this is out of scope for this PR.
ChayimFriedman2 added a commit to ChayimFriedman2/rust-analyzer that referenced this pull request Sep 10, 2024
This is a small change, but it was the cause of 90% of the errors in `rust-analyzer diagnostics .` 🫢

With this change and rust-lang#18085 together, all remaining errors are type errors.

This may mean we can enable more errors, but this is out of scope for this PR.
ChayimFriedman2 added a commit to ChayimFriedman2/rust-analyzer that referenced this pull request Sep 10, 2024
This is a small change, but it was the cause of 90% of the errors in `rust-analyzer diagnostics .` 🫢

With this change and rust-lang#18085 together, all remaining errors are type errors.

This may mean we can enable more errors, but this is out of scope for this PR.
ChayimFriedman2 added a commit to ChayimFriedman2/rust-analyzer that referenced this pull request Sep 10, 2024
This is a small change, but it was the cause of 90% of the errors in `rust-analyzer diagnostics .` 🫢

With this change and rust-lang#18085 together, all remaining errors are type errors.

This may mean we can enable more errors, but this is out of scope for this PR.
bors added a commit that referenced this pull request Sep 10, 2024
fix: Correctly escape strings in our quote macro

This is a small change, but it was the cause of 90% of the errors in `rust-analyzer diagnostics .` 🫢 (because this worked incorrectly with `stringify!()`, which means every `quote!()` (the original one) quoting a string also didn't work).

With this change and #18085 together, all remaining errors are type errors.

This may mean we can enable more errors, but this is out of scope for this PR.
@bors
Copy link
Collaborator

bors commented Sep 11, 2024

☔ The latest upstream changes (presumably #18057) made this pull request unmergeable. Please resolve the merge conflicts.

crates/rust-analyzer/src/config.rs Outdated Show resolved Hide resolved
crates/rust-analyzer/src/reload.rs Outdated Show resolved Hide resolved
crates/hir-def/src/nameres/collector.rs Outdated Show resolved Hide resolved
crates/hir-expand/src/builtin/attr_macro.rs Outdated Show resolved Hide resolved
@bors
Copy link
Collaborator

bors commented Sep 18, 2024

☔ The latest upstream changes (presumably #18117) made this pull request unmergeable. Please resolve the merge conflicts.

@Veykril Veykril added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 25, 2024
This will mean users opting to not activate `cfg(test)` will lose IDE experience on them, which is quite unfortunate, but this is unavoidable if we want to avoid false positives on e.g. diagnostics. The real fix is to provide IDE experience even for cfg'ed out code, but this is out of scope for this PR.
@ChayimFriedman2
Copy link
Contributor Author

@Veykril, addressed comments (side note: maybe use @rustbot author so we can use the labels to know the status of the PR?)

@Veykril
Copy link
Member

Veykril commented Sep 30, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 30, 2024

📌 Commit 4a06675 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Sep 30, 2024

⌛ Testing commit 4a06675 with merge ceee056...

@bors
Copy link
Collaborator

bors commented Sep 30, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing ceee056 to master...

@bors bors merged commit ceee056 into rust-lang:master Sep 30, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rust-analyzer.cargo.unsetTest is gone, what should I use as a substitute?
4 participants