# What is the current status of 'lexical lifetimes'?

**URL:** <https://forums.swift.org/t/what-is-the-current-status-of-lexical-lifetimes/76587>\
**Category:** Using Swift\
**Created:** [December 13, 2024, 4:07am UTC](https://forums.swift.org/t/what-is-the-current-status-of-lexical-lifetimes/76587 "2024-12-13T04:07:02Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jamieQ](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/jamieq/32/5117_2.png) [@jamieQ](https://forums.swift.org/u/jamieQ)\
**Post date:** [June 16, 2026, 11:39am UTC](https://forums.swift.org/t/what-is-the-current-status-of-lexical-lifetimes/76587/6 "2026-06-16T11:39:48Z")

</div>

> [@asdf\_bro](#):
>
> Are noncopyable structs like `UniqueArray` and `MutableSpan` eligible for `@_eagerMove` inference? And if so, are their lifetimes minimized, and their `deinit`s run immediately after their last uses?

IIUC, literally using `@_eagerMove` on a non-copyable type was explicitly banned ([here](https://github.com/swiftlang/swift/pull/65377/changes/525541fd1c6b57ea251e89f3689e4a8955b47017)), so simply adding the annotation is not possible. You can still place it on variable bindings of such types, but, at least in my basic experiments, it doesn't appear to have the effect of making their lifetimes non-lexical.

From source inspection, it looks like even if the annotations could be applied, they are currently overridden for non-copyable types, which seem to be [unconditionally lowered](https://github.com/swiftlang/swift/blob/28e69b8ec756455a6598e870163c995ba0993927/lib/SIL/IR/TypeLowering.cpp#L2713-L2719) to SIL with lexical lifetimes.

@Andrew_Trick covered some of the possible lifetime "categories" in [this related post](https://forums.swift.org/t/is-the-implicit-self-passed-to-instance-methods-always-strongly-retained/82301/5). It seems like you're asking if it's possible to get the "optimized lifetime" behavior for non-copyable types. Per that post, I would think it may be possible if you had an `~Escapable` value that was also `~Copyable` but without a custom deinit, but I've not been able to find any examples that actually demonstrate that is the case.

---

_[View the full topic](https://forums.swift.org/t/what-is-the-current-status-of-lexical-lifetimes/76587)._
