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

Don't diagnose accesses to global/static variables within the same module #73740

Conversation

DougGregor
Copy link
Member

When SE-0412 (strict concurrency for global variables) is enabled, each
global or static mutable variable will be diagnosed if it isn't
explicitly on a global actor or nonisolated(unsafe).

Suppress diagnostics for references to such global variables when they
are in the same module as the declaration of the global variable
itself. While these diagnostics are technically correct, they are not
strictly necessary since we've already diagnosed the global variable
itself (with more actionable advice), and they tend to pile on the
developer in a manner that is not helpful.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

…dule

When SE-0412 (strict concurrency for global variables) is enabled, each
global or static mutable variable will be diagnosed if it isn't
explicitly on a global actor or `nonisolated(unsafe)`.

Suppress diagnostics for references to such global variables when they
are in the same module as the declaration of the global variable
itself. While these diagnostics are technically correct, they are not
strictly necessary since we've already diagnosed the global variable
itself (with more actionable advice), and they tend to pile on the
developer in a manner that is not helpful.
@DougGregor DougGregor force-pushed the suppress-global-shared-state-diags-in-module branch from a0d7726 to e1a4a1e Compare May 20, 2024 01:35
@DougGregor
Copy link
Member Author

GitHub failed to stack PRs despite no differences; this already passed all PR testing.

@DougGregor DougGregor merged commit ada0482 into swiftlang:main May 20, 2024
@DougGregor DougGregor deleted the suppress-global-shared-state-diags-in-module branch May 20, 2024 01:36
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