# \[Pitch\] Noncopyable Standard Library Primitives

**URL:** <https://forums.swift.org/t/pitch-noncopyable-standard-library-primitives/71566>\
**Category:** Pitches\
**Created:** [May 2, 2024, 2:16am UTC](https://forums.swift.org/t/pitch-noncopyable-standard-library-primitives/71566 "2024-05-02T02:16:12Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![lorentey](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lorentey/32/1299_2.png) [@lorentey](https://forums.swift.org/u/lorentey)\
**Post date:** [May 3, 2024, 4:59am UTC](https://forums.swift.org/t/pitch-noncopyable-standard-library-primitives/71566/12 "2024-05-03T04:59:22Z")

</div>

> [@jrose](#):
>
> I worry a bit about not considering Error up front. If Error is ever going to become ~Copyable, Result's API would change _again._ On the other hand, whether Error should _permanently_ require Copyable seems worthy of discussion.

It seems unlikely to me that we would want to generalize `ErrorProtocol`; my expectation is that all errors need to be able to get caught by and propagated through existing code that isn't aware of noncopyable types. (Boxing them could get us there, though, I suppose.)

If noncopyable errors ever become a thing, I see no reason we couldn't generalize `Result` in a separate followup proposal, if and when it's time to do so. (For existing projects that use `Result`, these generalizations aren't disruptive changes -- no existing API gets deprecated, and (hopefully) there will be no need to migrate anything or to rewrite any existing code. Unless of course someone wants to adopt the new features.)

However, I think it's important to highlight that this is definitely not going to be the final proposal that messes with these types. I don't expect `Optional` & `Result` would cease evolving after the changes in this pitch ship.

In fact, we already know for sure that this is not their final form!

While this proposal is targeting Swift 6, over on Swift's `main` development branch [non-escaping types](https://forums.swift.org/t/pitch-non-escapable-types-and-lifetime-dependency/69865) are starting to take shape, too. Once they become a thing, we'll eventually need to have a second round of (smaller-scale) generalizations to allow `Optional` and `Result` to hold those, too. Ultimately, these types will need to become not just conditionally copyable, but also conditionally escaping.

Jumping from where we are in Swift 5.10 directly to that target would be way too large a leap: it makes more sense to go step by step. This pitch is opening new frontiers that are worthwhile on their own right. I think it's good to allow some time to explore this new space and get comfortable with its properties, if only to better understand why we need to take the next steps.

---

_[View the full topic](https://forums.swift.org/t/pitch-noncopyable-standard-library-primitives/71566)._
