# Lifetime Annotation Problem

**URL:** https://users.rust-lang.org/t/lifetime-annotation-problem/13840
**Category:** help
**Created:** [November 13, 2017, 2:14am UTC](https://users.rust-lang.org/t/lifetime-annotation-problem/13840 "2017-11-13T02:14:52Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![vitalyd](https://avatars.discourse-cdn.com/v4/letter/v/edb3f5/32.png) [@vitalyd](https://users.rust-lang.org/u/vitalyd)
#### Post date: [November 13, 2017, 2:51am UTC](https://users.rust-lang.org/t/lifetime-annotation-problem/13840/3 "2017-11-13T02:51:42Z")

</div>

Yes, this is due to mutable references. This comes up quite often, usually in the context of an `Iterator` returning mutable references. You can also get a bit more color if you search for "streaming iterators", which is a way to tie the mutable borrow to the `self` borrow - that prevents holding (potentially) multiple mutable aliases to the same value.

The long term solution to this is ATC (associated type constructors) which would allow you to express the streaming nature without having multiple versions of a trait.

You can work around this by using unsafe or switching to something like `RefCell` holding the value and letting it enforce borrow rules at runtime.

---

_[View the full topic](https://users.rust-lang.org/t/lifetime-annotation-problem/13840)._
