# \#ownership

**URL:** https://forums.swift.org/tag/ownership/3.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Rethinking propagation of ~Copyable and ~Escapable constraints](https://forums.swift.org/t/rethinking-propagation-of-copyable-and-escapable-constraints/90324)

<div class="topic-metadata">

**Author:** [@juliand665](https://forums.swift.org/u/juliand665)\
**Replies:** 6\
**Last updated:** [October 30, 2026, 9:13am UTC](https://forums.swift.org/t/rethinking-propagation-of-copyable-and-escapable-constraints/90324 "2026-10-30T09:13:38Z")

</div>

I've been writing a lot of code lately using ~Copyable and ~Escapable, and I keep butting heads with the compiler automatically inserting Copyable and Escapable constraints on protocols that refine ~Copyable and ~Escapab…

---

## [Lifetime dependency annotations and function subtyping](https://forums.swift.org/t/lifetime-dependency-annotations-and-function-subtyping/89243)

<div class="topic-metadata">

**Author:** [@zackbach](https://forums.swift.org/u/zackbach)\
**Replies:** 2\
**Last updated:** [September 2, 2026, 6:00pm UTC](https://forums.swift.org/t/lifetime-dependency-annotations-and-function-subtyping/89243 "2026-09-02T18:00:19Z")

</div>

When a function returns a non-escapable type that copies the lifetime dependencies of an input, the copy lifetime annotation is used: struct NE: ~Escapable { } @\_lifetime(copy ne) func copies(\_ ne: borrowing NE) -\> NE …

---

## [Lifetimes + different properties of an aggregate](https://forums.swift.org/t/lifetimes-different-properties-of-an-aggregate/83600)

<div class="topic-metadata">

**Author:** [@zackbach](https://forums.swift.org/u/zackbach)\
**Replies:** 5\
**Last updated:** [August 28, 2026, 5:36pm UTC](https://forums.swift.org/t/lifetimes-different-properties-of-an-aggregate/83600 "2026-08-28T17:36:32Z")

</div>

As I understand it, to enforce the Law of Exclusivity, accesses to properties stored in an aggregate (like p.x) in general are treated as accesses to the aggregate itself (in this case, p itself). There is a special case…

---

## [Ownership pattern matching questions](https://forums.swift.org/t/ownership-pattern-matching-questions/88887)

<div class="topic-metadata">

**Author:** [@Lancelotbronner](https://forums.swift.org/u/Lancelotbronner)\
**Replies:** 2\
**Last updated:** [August 10, 2026, 9:02pm UTC](https://forums.swift.org/t/ownership-pattern-matching-questions/88887 "2026-08-10T21:02:00Z")

</div>

I'm exploring ownership accessors by re-implementing Rust types in Swift. public enum Cow\<B : ToOwned & ~Copyable\> : Borrow, Clone, ~Escapable { /// Borrowed data. case borrowed(Ref\<B\>) /// Owned data. case owned(B.…

---

## [Existential casting of borrowed values](https://forums.swift.org/t/existential-casting-of-borrowed-values/88617)

<div class="topic-metadata">

**Author:** [@UniverseObserver](https://forums.swift.org/u/UniverseObserver)\
**Replies:** 2\
**Last updated:** [July 29, 2026, 6:48pm UTC](https://forums.swift.org/t/existential-casting-of-borrowed-values/88617 "2026-07-29T18:48:43Z")

</div>

Hi folks, I'm a mentee participating in the 2026 Swift Mentorship program. I have interest in the ownership system but I'm fairly new to the compiler implementation. While I'm investigating Borrowed value with \`as\` cast…

---

## [Borrowed value with \`as\` casting](https://forums.swift.org/t/borrowed-value-with-as-casting/88236)

<div class="topic-metadata">

**Author:** [@UniverseObserver](https://forums.swift.org/u/UniverseObserver)\
**Replies:** 4\
**Last updated:** [July 23, 2026, 2:12pm UTC](https://forums.swift.org/t/borrowed-value-with-as-casting/88236 "2026-07-23T14:12:30Z")

</div>

Hi, I'm a mentee participating in the Swift Mentorship program. I have interest in the ownership system but I'm fairly new to the compiler implementation. I am picking up issue Compiler crash: \`borrowing\` parameter in a…

---

## [\[Pitch\] borrow/mutate accessors, & immutable borrow, and mutating in signatures](https://forums.swift.org/t/pitch-borrow-mutate-accessors-immutable-borrow-and-mutating-in-signatures/85676)

<div class="topic-metadata">

**Author:** [@Arma](https://forums.swift.org/u/Arma)\
**Replies:** 5\
**Last updated:** [April 3, 2026, 6:58pm UTC](https://forums.swift.org/t/pitch-borrow-mutate-accessors-immutable-borrow-and-mutating-in-signatures/85676 "2026-04-03T18:58:13Z")

</div>

Hi everyone, I'd like to share a pitch that grew out of a real performance optimization effort where I was trying to eliminate unnecessary copies in hot loops on Copyable value types. This is my first pitch, so I appre…

---

## [Rename borrow / mutate Accessors and Borrow / Inout Types to borrowed / mutable](https://forums.swift.org/t/rename-borrow-mutate-accessors-and-borrow-inout-types-to-borrowed-mutable/85287)

<div class="topic-metadata">

**Author:** [@Dmitriy\_Ignatyev](https://forums.swift.org/u/Dmitriy_Ignatyev)\
**Replies:** 10\
**Last updated:** [March 26, 2026, 5:00pm UTC](https://forums.swift.org/t/rename-borrow-mutate-accessors-and-borrow-inout-types-to-borrowed-mutable/85287 "2026-03-26T17:00:57Z")

</div>

As stated in \[Accepted\] SE-0507: Borrow and Mutate Accessors, I want to pitch alternative names. Introduction This proposal suggests renaming ownership-related accessors and types introduced in: SE-0474: Yielding Acce…

---

## [Ownership adoption case study: building a wrapper type](https://forums.swift.org/t/ownership-adoption-case-study-building-a-wrapper-type/85275)

<div class="topic-metadata">

**Author:** [@CrystDragon](https://forums.swift.org/u/CrystDragon)\
**Replies:** 1\
**Last updated:** [March 12, 2026, 10:49pm UTC](https://forums.swift.org/t/ownership-adoption-case-study-building-a-wrapper-type/85275 "2026-03-12T22:49:53Z")

</div>

Hi, folks, I've been trying to adopt ownership features in my project, and during the work, I've found several points in the language that are holding me back. I want to share a case from my experience here. Motivation T…

---

## [\`copy\` operator doesn't clone a class instance](https://forums.swift.org/t/copy-operator-doesnt-clone-a-class-instance/84592)

<div class="topic-metadata">

**Author:** [@rayx](https://forums.swift.org/u/rayx)\
**Replies:** 5\
**Last updated:** [February 8, 2026, 3:49am UTC](https://forums.swift.org/t/copy-operator-doesnt-clone-a-class-instance/84592 "2026-02-08T03:49:56Z")

</div>

I found this when doing an experiment: class C { var value: String = "abc" consuming func consumeAndDuplicate() -\> (C, C) { let copy = copy self return (self, copy) } func dump() { …

---

## [Lifetime dependencies and conditionals](https://forums.swift.org/t/lifetime-dependencies-and-conditionals/83594)

<div class="topic-metadata">

**Author:** [@zackbach](https://forums.swift.org/u/zackbach)\
**Replies:** 10\
**Last updated:** [January 25, 2026, 9:42pm UTC](https://forums.swift.org/t/lifetime-dependencies-and-conditionals/83594 "2026-01-25T21:42:47Z")

</div>

Hello! I have three mostly-unrelated questions that all pertain to the interactions between lifetime dependencies / conditionals / reassignment / inout argument dependence. I thought that I would group them here, rather …

---

## [\`exclusive\` parameter ownership modifier](https://forums.swift.org/t/exclusive-parameter-ownership-modifier/83503)

<div class="topic-metadata">

**Author:** [@John\_McCall](https://forums.swift.org/u/John_McCall)\
**Replies:** 27\
**Last updated:** [December 29, 2025, 11:17pm UTC](https://forums.swift.org/t/exclusive-parameter-ownership-modifier/83503 "2025-12-29T23:17:16Z")

</div>

Introduction mutating methods require the caller to ensure that the location passed as self can only be accessed through self. This guarantee of exclusive access is a very strong property that can be used by carefully wr…

---

## [Is the implicit \`self\` passed to instance methods always strongly retained?](https://forums.swift.org/t/is-the-implicit-self-passed-to-instance-methods-always-strongly-retained/82301)

<div class="topic-metadata">

**Author:** [@winstondu](https://forums.swift.org/u/winstondu)\
**Replies:** 13\
**Last updated:** [September 23, 2025, 9:37pm UTC](https://forums.swift.org/t/is-the-implicit-self-passed-to-instance-methods-always-strongly-retained/82301 "2025-09-23T21:37:32Z")

</div>

This is an almost “trivial” thing (and I think we all know the answer), but even after hours of digging, I’m surprised I found absolutely NO clearly stated guarantee in the Swift language official specification about th…

---

## [Borrowing still creates a copy of the method parameter?!](https://forums.swift.org/t/borrowing-still-creates-a-copy-of-the-method-parameter/82291)

<div class="topic-metadata">

**Author:** [@winstondu](https://forums.swift.org/u/winstondu)\
**Replies:** 10\
**Last updated:** [September 22, 2025, 11:55pm UTC](https://forums.swift.org/t/borrowing-still-creates-a-copy-of-the-method-parameter/82291 "2025-09-22T23:55:31Z")

</div>

I’m trying to build an intuition for the parameter ownership modifiers—specifically borrowing—as described in SE-0377. My mental model (possibly wrong!) is that a borrowing parameter gives the callee temporary, read-only…

---

## [Clarifying questions regarding \`consuming\` parameters and the \`consume\` operator](https://forums.swift.org/t/clarifying-questions-regarding-consuming-parameters-and-the-consume-operator/81453)

<div class="topic-metadata">

**Author:** [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Replies:** 12\
**Last updated:** [August 13, 2025, 2:34am UTC](https://forums.swift.org/t/clarifying-questions-regarding-consuming-parameters-and-the-consume-operator/81453 "2025-08-13T02:34:19Z")

</div>

i am wondering about a few recently-filed issues & topics relating to variable lifetime rules and diagnostics. the first is Compiler fails to prevent consuming parameter implicitly copied · Issue #83393 · swiftlang/swif…

---

## [Why is \`self\` considered used-after-consume in coroutine accessors?](https://forums.swift.org/t/why-is-self-considered-used-after-consume-in-coroutine-accessors/81517)

<div class="topic-metadata">

**Author:** [@CrystDragon](https://forums.swift.org/u/CrystDragon)\
**Replies:** 4\
**Last updated:** [August 8, 2025, 3:19am UTC](https://forums.swift.org/t/why-is-self-considered-used-after-consume-in-coroutine-accessors/81517 "2025-08-08T03:19:34Z")

</div>

I used the following code to implement a wrapper type. However the compiler complained "'self' used after consume": import Foundation public struct Wrapper\<T: ~Copyable\>: ~Copyable { private var core: T @usab…

---

## [Borrowing: Works with struct but fails with tuple](https://forums.swift.org/t/borrowing-works-with-struct-but-fails-with-tuple/81444)

<div class="topic-metadata">

**Author:** [@saulpalv](https://forums.swift.org/u/saulpalv)\
**Replies:** 3\
**Last updated:** [August 3, 2025, 11:34am UTC](https://forums.swift.org/t/borrowing-works-with-struct-but-fails-with-tuple/81444 "2025-08-03T11:34:17Z")

</div>

I have a code that has same data in two forms Tuple and Struct, they are both tested by converting to the same Final Struct, however the code only compiles for the struct whereas fails for the tuple, is there something f…

---

## [When are you supposed to use ownership modifiers?](https://forums.swift.org/t/when-are-you-supposed-to-use-ownership-modifiers/79538)

<div class="topic-metadata">

**Author:** [@Danny](https://forums.swift.org/u/Danny)\
**Replies:** 8\
**Last updated:** [June 12, 2025, 3:49pm UTC](https://forums.swift.org/t/when-are-you-supposed-to-use-ownership-modifiers/79538 "2025-06-12T15:49:59Z")

</div>

Using Optional as a reference, it seems to me like we ought to be decorating our code accordingly now. I haven't seen any good guide on when or how, though, ever. I also have no idea how to verify the correctness of any …

---

## [Capture noncopyable in closure](https://forums.swift.org/t/capture-noncopyable-in-closure/80460)

<div class="topic-metadata">

**Author:** [@hguandl](https://forums.swift.org/u/hguandl)\
**Replies:** 1\
**Last updated:** [June 14, 2025, 6:27am UTC](https://forums.swift.org/t/capture-noncopyable-in-closure/80460 "2025-06-14T06:27:08Z")

</div>

Hi there, I'm experimenting with noncopyable types in Swift and encountered a problem when trying to consume a value within a closure. Here's a minimal reproduction: struct Foo: ~Copyable { } func withBlock(\_ block: ()…

---

## ['static consuming func ...' throws 'Static functions must not be declared mutating' compiler error?](https://forums.swift.org/t/static-consuming-func-throws-static-functions-must-not-be-declared-mutating-compiler-error/79949)

<div class="topic-metadata">

**Author:** [@CodebyCR](https://forums.swift.org/u/CodebyCR)\
**Replies:** 2\
**Last updated:** [May 17, 2025, 2:24pm UTC](https://forums.swift.org/t/static-consuming-func-throws-static-functions-must-not-be-declared-mutating-compiler-error/79949 "2025-05-17T14:24:09Z")

</div>

Hey there, I wrote some Swift code as I got the following compiler error: 'Static functions must not be declared mutating' I was confused, because I try to avoid mutations if I can. So I simplified the method and g…

---

## [\[Pitch\] MutableSpan](https://forums.swift.org/t/pitch-mutablespan/77790)

<div class="topic-metadata">

**Author:** [@glessard](https://forums.swift.org/u/glessard)\
**Replies:** 47\
**Last updated:** [February 24, 2025, 5:59pm UTC](https://forums.swift.org/t/pitch-mutablespan/77790 "2025-02-24T17:59:56Z")

</div>

Hello everyone! Continuing on from adding Span/RawSpan (SE-0447) and the computed properties that return them (SE-0456), this is a pitch for MutableSpan and MutableRawSpan, helper types to delegate mutations of exclusive…

---

## [\`borrowing\` + \`sending\` not allowed?](https://forums.swift.org/t/borrowing-sending-not-allowed/74711)

<div class="topic-metadata">

**Author:** [@vns](https://forums.swift.org/u/vns)\
**Replies:** 1\
**Last updated:** [September 18, 2024, 9:54pm UTC](https://forums.swift.org/t/borrowing-sending-not-allowed/74711 "2024-09-18T21:54:36Z")

</div>

I've been playing with some ways to work together with sending and ownership, and stumbled across case I'm not sure how to treat: class NonSendable { } func foo(bar: borrowing sending NonSendable) { // error: 'sending…

---

## [SE-0427: Noncopyable Generics](https://forums.swift.org/t/se-0427-noncopyable-generics/70525)

<div class="topic-metadata">

**Author:** [@hborla](https://forums.swift.org/u/hborla)\
**Replies:** 164\
**Last updated:** [July 3, 2024, 12:05am UTC](https://forums.swift.org/t/se-0427-noncopyable-generics/70525 "2024-07-03T00:05:24Z")

</div>

Hello, Swift community! The review of SE-0427: Noncopyable Generics begins now and runs through March 22nd, 2024. Reviews are an important part of the Swift evolution process. All review feedback should be either on th…

---

## [Isolated consuming argument](https://forums.swift.org/t/isolated-consuming-argument/72649)

<div class="topic-metadata">

**Author:** [@Nickolas\_Pohilets](https://forums.swift.org/u/Nickolas_Pohilets)\
**Replies:** 0\
**Last updated:** [June 21, 2024, 11:55am UTC](https://forums.swift.org/t/isolated-consuming-argument/72649 "2024-06-21T11:55:13Z")

</div>

I'm seeing a weird error when trying to use isolated and consuming together. This compiles fine: protocol UsableActor: Actor { borrowing func useIt() } func keepBusy\<T: UsableActor\>(\_ actor: consuming isolated T) { …

---

## [Can ownership features streamline apis that provide a temporary value?](https://forums.swift.org/t/can-ownership-features-streamline-apis-that-provide-a-temporary-value/72098)

<div class="topic-metadata">

**Author:** [@gwendal.roue](https://forums.swift.org/u/gwendal.roue)\
**Replies:** 6\
**Last updated:** [May 27, 2024, 10:15pm UTC](https://forums.swift.org/t/can-ownership-features-streamline-apis-that-provide-a-temporary-value/72098 "2024-05-27T22:15:44Z")

</div>

Hello, I was discussing with a coworker of mine about withUnsafeBufferPointer,withContiguousStorageIfAvailable, and generally all withXxx methods whose closure input is only valid during the execution of the method. It …

---

## [Reading a computed property in a method consumes self but only in some cases?](https://forums.swift.org/t/reading-a-computed-property-in-a-method-consumes-self-but-only-in-some-cases/71444)

<div class="topic-metadata">

**Author:** [@corbeling](https://forums.swift.org/u/corbeling)\
**Replies:** 5\
**Last updated:** [April 26, 2024, 5:48pm UTC](https://forums.swift.org/t/reading-a-computed-property-in-a-method-consumes-self-but-only-in-some-cases/71444 "2024-04-26T17:48:25Z")

</div>

Hi folks! I'm learning Swift and I've been playing around with borrowing and consuming, and I ran into something I don't quite understand. It seems that in a generic struct that has a stored property with the generic t…

---

## [Ownership control for BitwiseCopyable types](https://forums.swift.org/t/ownership-control-for-bitwisecopyable-types/71289)

<div class="topic-metadata">

**Author:** [@jcavar](https://forums.swift.org/u/jcavar)\
**Replies:** 0\
**Last updated:** [April 16, 2024, 1:08pm UTC](https://forums.swift.org/t/ownership-control-for-bitwisecopyable-types/71289 "2024-04-16T13:08:17Z")

</div>

In this thread @Andrew\_Trick mentioned the following: I am wondering if this code makes sense then and if it should be allowed: func borrowMe(x: borrowing Int) { // ... } Additionally, isn't it desirable to provi…

---

## [Missing compiler diagnostics with ~Copyable property wrapper in function argument](https://forums.swift.org/t/missing-compiler-diagnostics-with-copyable-property-wrapper-in-function-argument/71238)

<div class="topic-metadata">

**Author:** [@Dmitriy\_Ignatyev](https://forums.swift.org/u/Dmitriy_Ignatyev)\
**Replies:** 0\
**Last updated:** [April 13, 2024, 3:09pm UTC](https://forums.swift.org/t/missing-compiler-diagnostics-with-copyable-property-wrapper-in-function-argument/71238 "2024-04-13T15:09:59Z")

</div>

I'm trying to implement a closure that can only be called one time. Doing that I met weird compiler behaviour, which I describe in the comments below. @propertyWrapper struct OnceCalledClosureWrapper: ~Copyable { pri…

---

## [What could cause \_swift\_release\_dealloc to segfault?](https://forums.swift.org/t/what-could-cause-swift-release-dealloc-to-segfault/68506)

<div class="topic-metadata">

**Author:** [@taylorswift](https://forums.swift.org/u/taylorswift)\
**Replies:** 6\
**Last updated:** [February 14, 2024, 11:41pm UTC](https://forums.swift.org/t/what-could-cause-swift-release-dealloc-to-segfault/68506 "2024-02-14T23:41:41Z")

</div>

well this is concerning: 💣 Program crashed: Bad pointer dereference at 0x0000000000000000 Thread 3 crashed: 0 0x00007f2415fc28dd \_swift\_release\_dealloc + 13 in libswiftCore.so 1 0x00007f2415fc329b bool swift::RefCount…

---

## [Usage of no-implicit-copy value that the compiler can't verify](https://forums.swift.org/t/usage-of-no-implicit-copy-value-that-the-compiler-cant-verify/68675)

<div class="topic-metadata">

**Author:** [@jcavar](https://forums.swift.org/u/jcavar)\
**Replies:** 0\
**Last updated:** [November 28, 2023, 3:55pm UTC](https://forums.swift.org/t/usage-of-no-implicit-copy-value-that-the-compiler-cant-verify/68675 "2023-11-28T15:55:07Z")

</div>

The following code snippet raises the following compiler error: "Usage of no-implicit-copy value that the compiler can't verify. This is a compiler bug. Please file a bug with a small example of the bug" protocol TestP…

[Next page](https://forums.swift.org/tag/ownership/3.md?match_all_tags=true&page=1&tags%5B%5D=ownership)
