# How to represent function with lifetime parameters in trait bounds?

**URL:** <https://users.rust-lang.org/t/how-to-represent-function-with-lifetime-parameters-in-trait-bounds/142318>\
**Category:** help\
**Created:** [September 8, 2026, 12:02am UTC](https://users.rust-lang.org/t/how-to-represent-function-with-lifetime-parameters-in-trait-bounds/142318 "2026-09-08T00:02:33Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![quinedot](https://sea1.discourse-cdn.com/flex019/user_avatar/users.rust-lang.org/quinedot/32/17693_2.png) [@quinedot](https://users.rust-lang.org/u/quinedot)\
**Post date:** [September 8, 2026, 2:19am UTC](https://users.rust-lang.org/t/how-to-represent-function-with-lifetime-parameters-in-trait-bounds/142318/6 "2026-09-08T02:19:11Z")

</div>

This reminds me of [this exercise](https://users.rust-lang.org/t/problems-matching-up-lifetimes-between-various-traits-and-closure-parameters/71994/7)\[1\] or perhaps [this topic.](https://users.rust-lang.org/t/lieftime-issue-implementation-of-function-is-not-general-enough/77222) You can get it to work to some extent, but there's usually a significant inference hit and/or a ton of boilerplate, especially when you extend arity. You may also have to make some compromises if you're going to try to take multiple args but return a single `Value<'_>` somehow (it's not clear to me what you want from larger arities).

> [@robofinch](#):
>
> Ahhh it’s complaining that `T::Output<'a>`, as a concrete type, need not actually use `'a`.

For example, one way to work around this is by starting with single lifetime traits and wrapping those up in higher-ranked lifetime traits, [but it will completely ruin inference.](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=d088c41c4e79586818784e0c0b386165) If you can find a way to get the `Fn` bound back to being directly on the implementation, that usually helps inference, but may involve compromises like the `PhantomData` suggestion,\[2\] or [implementing for specific type constructors](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=a247dd0ab6d2986a67ee295069ee9c58) instead of generically.

* * *

1. Written pre-GAT -- SIAR is like a GAT 

2. I like `[&'a (); 0]` or similar zero-size arrays for lifetime dummy args.

---

_[View the full topic](https://users.rust-lang.org/t/how-to-represent-function-with-lifetime-parameters-in-trait-bounds/142318)._
