Skip to content

[6.1][Concurrency/Diagnostics] A few fixes to diagnostic downgrades and tracking #79601

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 2 commits into from
Feb 26, 2025

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 25, 2025

Cherry-pick of #79599


  • Explanation:

    Fixes incorrect statistics reporting for Swift 6 errors when presence of @preconcurrency downgrades them into ignored state.

    • Avoid downgrading diagnostics multiple times

      Unify warn + limitBehavior into a single call to make sure
      that diagnostic doesn't get downgraded multiple times because
      that could affect how diagnostics are tracked.

    • Don't account ignored diagnostics in Sema.NumSwift6Errors statistic

      Since the diagnostic is not going to be emitted counting it in
      Swift6Errors statistics is going to be confusing to the users.

  • Main Branch PR: [Concurrency/Diagnostics] A few fixes to diagnostic downgrades and tracking #79599

  • Risk: Very low (only non-NFC part here is related to statistics which are not enabled by default).

  • Resolves: rdar://145341605

  • Reviewed By: @hborla

  • Testing: Non-NFC only for statistics

Unify `warn` + `limitBehavior` into a single call to make sure
that diagnostic doesn't get downgraded multiple times because
that could affect how diagnostics are tracked.

(cherry picked from commit 1649b5e)
…t6Errors` statistic

Since the diagnostic is not going to be emitted counting it in
`Swift6Errors` statistics is going to be confusing to the users.

Resolves: swiftlang#79291
Resolves: rdar://145341605
(cherry picked from commit 664c119)
@xedin xedin requested a review from hborla February 25, 2025 02:22
@xedin xedin requested a review from a team as a code owner February 25, 2025 02:22
@xedin
Copy link
Contributor Author

xedin commented Feb 25, 2025

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 25, 2025

@swift-ci please clean test macOS platform

@xedin
Copy link
Contributor Author

xedin commented Feb 25, 2025

@swift-ci please test macOS platform

@xedin xedin merged commit 7ccb2c1 into swiftlang:release/6.1 Feb 26, 2025
5 checks passed
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.

2 participants