Skip to content

Conversation

hnrklssn
Copy link
Contributor

@hnrklssn hnrklssn commented Oct 4, 2025

This adds the -verify-ignore-unrelated flag. When -verify is used without -verify-ignore-unrelated, diagnostics emitted in buffers other than the main file and those passed with -verify-additional-file (except diagnostics emitted at <unknown>:0) will now result in an error. They were previously ignored. The old behaviour is still available as opt-in using -verify-ignore-unrelated, but by being strict by default it should make it harder to accidentally miss diagnostics.

To avoid unnecessary performance overhead, -verify-additional-file is still required to parse the expected-* directives in files other than the main file.

Out of 4395 files using -verify, 404 required reverting to the old behaviour. I have not analysed the failures to decide whether adding expected-* directives would be more suitable for each test. I simply seded each file that failed with the new behaviour to restore the old one. But since they were already using the old behaviour there's at least no regression in test coverage.

The bulk changes to the tests are in a separate commit. I recommend reviewing each commit separately.

@hnrklssn
Copy link
Contributor Author

hnrklssn commented Oct 4, 2025

@swift-ci please smoke test

This adds the implementation required for later changing the default
behaviour of the -verify flag to error when diagnostics are emitted
in buffers other than the main file and files added with
-verify-additional-file. To keep the current behaviour, use the flag
-verify-ignore-unrelated. This flag is added as a no-op so that tests
can start using it before the new behaviour is enabled by default.
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
This enables the previously added -verify-ignore-unrelated flag. When
-verify is used without -verify-ignore-unrelated, diagnostics emitted in
buffers other than the main file and those passed with
-verify-additional-file (except diagnostics emitted at <unknown>:0) will
now result in an error. They were previously ignored. The old behaviour
is still available as opt-in using -verify-ignore-unrelated.
@hnrklssn
Copy link
Contributor Author

hnrklssn commented Oct 4, 2025

@swift-ci please smoke test

@asl
Copy link
Contributor

asl commented Oct 5, 2025

autodiff test changes LGTM

@hnrklssn
Copy link
Contributor Author

hnrklssn commented Oct 5, 2025

@swift-ci please smoke test

@hnrklssn
Copy link
Contributor Author

hnrklssn commented Oct 5, 2025

@swift-ci please smoke test

@hnrklssn
Copy link
Contributor Author

hnrklssn commented Oct 7, 2025

Merging this to help figure out what's going on with Windows in #84642. Feel free to post-review!

@hnrklssn hnrklssn merged commit d3214de into swiftlang:main Oct 7, 2025
3 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