Skip to content

No way to generate a ~Copyable struct with a SwiftDestroyOp and owned memory lifetime via API Notes #89243

@bruxisma

Description

@bruxisma

Description

When wrapping a C library that follows the typical approach of a Create/Destroy combination and also cannot be cloned or copied, there is no way to specify in any capacity that the C struct cannot be copied, there is a SwiftDestroyOp, and the result of the function cannot be inferred to be marked as owned.

Reproduction

Specify this information in a .apinote, any C API will do.

Expected behavior

The swift compiler skips the entire operation, ignoring the definition/information entirely.

Environment

Swift version 6.3.2 (swift-6.3.2-RELEASE)
Target: x86_64-unknown-windows-msvc
Build config: +assertions

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage neededThis issue needs more specific labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions