Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

lifetime bound

A requirement that a type's references stay valid for at least a given lifetime.

T: 'a requires every reference inside T to outlive 'a; 'b: 'a requires region 'b to outlive 'a.

Examples

  • fn keep<T: 'static>(t: T) accepts String::from("x"), which holds no borrow, but rejects &local for a local String with E0597.

Read the full section →