Is there a tiny error in section 6.2 Reference types?

⚓ Rust    📅 2026-04-23    👤 surdeus    👁️ 1      

surdeus

See Reference types - Learning Rust

// The exact lifetime of `'a` is determined at each call site.  We'll explore
// what this means in more depth later.
//
// The lifetime of `b` works the same, we just didn't give it a name.

I would write the first part as

// The exact lifetime of `a` is determined at each call site.

or

// The exact lifetime `'a` is determined at each call site.

Note, that in the first version I have removed the ' so that we refer to the variable directly, and that I have removed in the second version the "of", so that we refer to the generic lifetime directly. (a lifetime of a generic lifetime would be a bit strange?)

Perhaps we should actually write

// The exact lifetime `'a` of parameter `a`is determined at each call site.

1 post - 1 participant

Read full topic

🏷️ Rust_feed