Skip to content

internal: Make flycheck generational #20419

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 1 commit into from
Aug 10, 2025

Conversation

ShoyuVanilla
Copy link
Member

Resolves #19854

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2025
@@ -138,36 +142,62 @@ pub(crate) struct FlycheckHandle {
sender: Sender<StateChange>,
_thread: stdx::thread::JoinHandle,
id: usize,
generation: Mutex<DiagnosticsGeneration>,
Copy link
Member

@Veykril Veykril Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given thats just a type alias might as well use an AtomicUsize here (with relaxed orderings)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or do we need to Syncness here in general? If not Cell<usize> ought to work

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess there won't be concurrent problems in general but we have this line that demands this to be sync:

pub(crate) flycheck: Arc<[FlycheckHandle]>,

I've used mutex just because some platforms might not support AtomicUsize but using it seems better since major platforms support it

@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Aug 10, 2025
Merged via the queue into rust-lang:master with commit 4e147e7 Aug 10, 2025
15 checks passed
@ShoyuVanilla ShoyuVanilla deleted the flyck-gen branch August 10, 2025 14:12
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 10, 2025
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.

Make flycheck diagnostics track their generation
3 participants