# Is this closure\_lifetime\_binder unsoundness already covered by #25860?

**URL:** <https://internals.rust-lang.org/t/is-this-closure-lifetime-binder-unsoundness-already-covered-by-25860/24704>\
**Category:** Uncategorized\
**Created:** [October 25, 2026, 7:43am UTC](https://internals.rust-lang.org/t/is-this-closure-lifetime-binder-unsoundness-already-covered-by-25860/24704 "2026-10-25T07:43:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cushionbadak](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/cushionbadak/32/11667_2.png) [@cushionbadak](https://internals.rust-lang.org/u/cushionbadak)\
**Post date:** [October 25, 2026, 7:43am UTC](https://internals.rust-lang.org/t/is-this-closure-lifetime-binder-unsoundness-already-covered-by-25860/24704/1 "2026-10-25T07:43:22Z")

</div>

I discovered a #25860-like unsoundness while experimenting with `closure_lifetime_binder`, and I'm not sure where (or whether) to report it, so I'm asking here.

```rust
#![forbid(unsafe_code)]
#![feature(closure_lifetime_binder)]

static UNIT: &'static &'static () = &&();

fn extend<'x>(r: &'x String) -> &'static String {
    let f = for<'a, 'b> |_: &'a &'b (), v: &'b String| -> &'a String { v };
    let g: fn(&'static &'static (), &'x String) -> &'static String = f;
    g(UNIT, r)
}

fn main() {
    let r: &'static String;
    {
        let s = String::from("abcd");
        r = extend(&s);
    }
    println!("{}", r);
}

```

This compiles on `nightly-2026-10-25`, and Miri reports a use-after-free.

While narrowing it down, I found that the feature isn't required. The same thing happens on stable with a plain closure, without the feature attribute and replacing the `let f` line with:

```rust
let f: for<'a, 'b> fn(&'a &'b (), &'b String) -> &'a String = |_, v| v;

```

I don't think this is new, but is it worth noting somewhere (#25860 and #97362 are locked), or is it fine to leave it?

---

<div class="post-metadata">

**Author:** ![theemathas](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/theemathas/32/11817_2.png) [@theemathas](https://internals.rust-lang.org/u/theemathas)\
**Post date:** [October 25, 2026, 8:23am UTC](https://internals.rust-lang.org/t/is-this-closure-lifetime-binder-unsoundness-already-covered-by-25860/24704/2 "2026-10-25T08:23:39Z")

</div>

This is fundamentally the same setup as the one in the comment at [Implied bounds on nested references + variance = soundness hole · Issue #25860 · rust-lang/rust · GitHub](https://github.com/rust-lang/rust/issues/25860#issuecomment-173918580), so I don't think this needs to be reported.

---

<div class="post-metadata">

**Author:** ![cushionbadak](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/cushionbadak/32/11667_2.png) [@cushionbadak](https://internals.rust-lang.org/u/cushionbadak)\
**Post date:** [October 25, 2026, 9:12am UTC](https://internals.rust-lang.org/t/is-this-closure-lifetime-binder-unsoundness-already-covered-by-25860/24704/3 "2026-10-25T09:12:42Z")

</div>

Thanks, I'll leave it then.
