Skip to content

Conversation

@kavon
Copy link
Member

@kavon kavon commented Oct 23, 2025

I'm flipping the polarity of things.

The flag -enable-experimental-feature ManualOwnership now turns on the diagnostics,
but they're all silenced by default. So, you need to add -Wwarning or -Werror to
your build settings to turn on the specific diagnostics you care about.

These are the diagnostic groups relevant to the feature:

  • SemanticCopies aka "explicit copies mode"
  • DynamicExclusivity

For example, the build setting -Werror SemanticCopies now gives you errors about
explicit copies, just as before, but now you can make them just warnings with -Wwarning.

To opt-out a declaration from everything when using the feature, use @_noManualOwnership.

@_manualOwnership is no longer an attribute as a result.

resolves rdar://163372569

@kavon kavon force-pushed the manual-ownership/usability-fixes-6 branch from 393f3f8 to 09abb91 Compare October 24, 2025 23:53
kavon added 3 commits October 24, 2025 16:59
This includes documentation to explain how to understand
these diagnostics.
We can add warnings about dynamic exclusivity
checks that may happen on an access, with
explainers about why they happen for safety.
@kavon kavon force-pushed the manual-ownership/usability-fixes-6 branch from 09abb91 to 1d6ce7c Compare October 24, 2025 23:59
@kavon kavon changed the title ManualOwnership: use diagnostic groups; provide ability to warn about dynamic exclusivity ManualOwnership: provide ability to apply to entire compilation unit Oct 25, 2025
@kavon kavon marked this pull request as ready for review October 25, 2025 00:02
@kavon
Copy link
Member Author

kavon commented Oct 25, 2025

@swift-ci smoke test

@kavon kavon enabled auto-merge October 25, 2025 00:02
@kavon kavon requested a review from artemcm October 25, 2025 00:04
With this patch, I'm flipping the polarity of things.

The flag `-enable-experimental-feature ManualOwnership` now turns on the diagnostics,
but they're all silenced by default. So, you need to add -Wwarning or -Werror to
your build settings to turn on the specific diagnostics you care about.

These are the diagnostic groups relevant to the feature:

- SemanticCopies aka "explicit copies mode"
- DynamicExclusivity

For example, the build setting `-Werror SemanticCopies` now gives you errors about
explicit copies, just as before, but now you can make them just warnings with -Wwarning.

To opt-out a declaration from everything when using the feature, use @_noManualOwnership.

@_manualOwnership is no longer an attribute as a result.

resolves rdar://163372569
@kavon kavon force-pushed the manual-ownership/usability-fixes-6 branch from 1d6ce7c to 2d881bd Compare October 25, 2025 01:54
@kavon
Copy link
Member Author

kavon commented Oct 25, 2025

@swift-ci smoke test

@kavon kavon merged commit 03d61ed into swiftlang:main Oct 25, 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.

1 participant