# It is recommended to increase the default lifetimes

**URL:** <https://internals.rust-lang.org/t/it-is-recommended-to-increase-the-default-lifetimes/17944>\
**Category:** language design\
**Created:** [December 9, 2022, 7:10pm UTC](https://internals.rust-lang.org/t/it-is-recommended-to-increase-the-default-lifetimes/17944 "2022-12-09T19:10:05Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [December 10, 2022, 9:47pm UTC](https://internals.rust-lang.org/t/it-is-recommended-to-increase-the-default-lifetimes/17944/21 "2022-12-10T21:47:17Z")

</div>

> [@tczajka](#):
>
> References were magical, I didn't really know what was going on, sometimes I got the code to work, other times the compiler was complaining about references, and I could not figure out the pattern to it.

TBH, I do think that the elision rules could do with some tweaks. For example, it's unclear to me whether the ones for trait objects are a net win ([Consider re-tuning the lifetime elision rules for trait objects · Issue #91302 · rust-lang/rust · GitHub](https://github.com/rust-lang/rust/issues/91302)), and cramertj has previously brought up another weirdness ([Elision in method can take `'static` from `self`, perhaps surprising · Issue #48686 · rust-lang/rust · GitHub](https://github.com/rust-lang/rust/issues/48686)). Another thing that comes to mind is that perhaps we should tweak elision for `-> Ref<'_, &Foo>` functions because with _two_ lifetimes it's not obvious that things like the "just take it from `self`" rule make sense.

Elision rules are exactly the kind of thing we can tweak in an edition -- the migration lint can always just write them out in full, if necessary -- so I'd love to see an RFC show up with an analysis of a bunch of cases where they're more confusing than helpful, and a corresponding set of more restricted elision rules to apply in the 2024 edition.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [March 10, 2023, 9:47pm UTC](https://internals.rust-lang.org/t/it-is-recommended-to-increase-the-default-lifetimes/17944/22 "2023-03-10T21:47:32Z")

</div>

Closed on March 10, 2023, 9:47pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

[Previous page](https://internals.rust-lang.org/t/it-is-recommended-to-increase-the-default-lifetimes/17944.md?page=1)
