Skip to content

Comment on RFC: Rust Has Provenanceparent

Comments

I was speaking more abstractly.

Strictly speaking, a pointer points to 1 address, not a set.

Abstractly speaking, a lifetime represents a set of memory that lives a certain length of time, and thus also represents the set of memory a reference with that lifetime can reference.

It's just a different way of thinking about lifetimes which helped me understand them.

a pointer points to 1 address, not a set.

Rust "fat pointers" like `&str` contain a length as well.

represents the set of memory a reference with that lifetime can reference.

No, you can have memory that is alive for a particular lifetime but that you are not allowed to access via a pointer with said lifetime (because it's out of bounds).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.