---
title: "Chapter 17: Lifetimes"
description: "The 6 lessons of chapter 17: Lifetimes, in teaching order."
url: "https://learnrust.net/chapter-17/"
last_updated: "2026-06-13"
---

# Chapter 17: Lifetimes

- [17.1 What lifetimes are](https://learnrust.net/chapter-17/what-lifetimes-are.md): Every reference has a lifetime, the span during which it's valid; you've used them implicitly since chapter 9, and this chapter just makes them explicit.
- [17.2 Lifetime annotations in functions](https://learnrust.net/chapter-17/lifetime-annotations-in-functions.md): The 'a syntax on a function that returns a reference, the longest example, and the crucial point that an annotation describes a relationship, it never extends a lifetime.
- [17.3 Lifetimes in structs](https://learnrust.net/chapter-17/lifetimes-in-structs.md): How a struct can hold a reference by declaring a lifetime parameter, what the annotation guarantees, and why owned fields remain the simpler default.
- [17.4 Elision rules](https://learnrust.net/chapter-17/elision-rules.md): The three lifetime elision rules that let the compiler infer lifetimes on most function signatures, applied to functions you've already written without thinking about them.
- [17.5 The 'static lifetime](https://learnrust.net/chapter-17/the-static-lifetime.md): The 'static lifetime is the whole-program lifetime of string literals, and why adding 'static to silence the borrow checker is usually the wrong fix.
- [17.x Chapter 17 summary and quiz](https://learnrust.net/chapter-17/chapter-17-summary-and-quiz.md): Review of what lifetimes are, annotations on functions and structs, the elision rules, and the 'static lifetime, with a chapter quiz.

## Sitemap

See the full [sitemap](https://learnrust.net/sitemap.md) for all pages.
