swift-testing icon indicating copy to clipboard operation
swift-testing copied to clipboard

Adopt `@section` and `@used`.

Open grynspan opened this issue 4 weeks ago • 1 comments

This PR adopts the @section and @used attributes now available in the Swift 6.3 toolchain. These attributes replace the experimental @_section and @_used attributes verbatim and they are always enabled (so no need to check hasFeature(SymbolLinkageMarkers).)

Because these attributes are only available with the Swift 6.3 toolchain, we do not use them when building with Swift 6.2. Instead, if you build with Swift 6.2 you continue to use the "legacy" test discovery mechanism based on type metadata emission. The "legacy" mechanism will be removed in a future update.

Because the _TestDiscovery target needs to continue to compile with Swift 6.2, I have not switched us over to objectFormat() yet. See #1370 for details.

Resolves #1371.

Checklist:

  • [x] Code and documentation should follow the style of the Style Guide.
  • [x] If public symbols are renamed or modified, DocC references should be updated.

grynspan avatar Nov 10 '25 15:11 grynspan

Blocked by https://github.com/swiftlang/swift/issues/85411.

grynspan avatar Nov 10 '25 16:11 grynspan