rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.79k stars 261 forks source link

Is this a typo? The *lifetime* (should be *reference*?) is alive from the place it is created to its last use. #285

Closed Celthi closed 3 years ago

Celthi commented 3 years ago

This line says

The lifetime (sometimes called a borrow) is alive from the place it is created to its last use.

But at the beginning of the page, it says

Lifetimes are named regions of code that a reference must be valid for.

Combining these two sentences, the named region of code is alive from the place it is created to its last use. I don't get the idea of this combined sentence. Is the "lifetime is alive" actually "reference is alive"?

JohnTitor commented 3 years ago

Hmm, that may be confusing, yeah. As you suggested, we could simply replace it with "reference", I think.

Celthi commented 3 years ago

If that's the case, I'll raise the PR to rename it.

Celthi commented 3 years ago

Fix PR is https://github.com/rust-lang/nomicon/pull/286