3 ms·
It's not quite supported in Rust, as far as I understand it. Say I have two local variables: 'ptr' and 'itr.' 'ptr' is an owning pointer to a region containing
by rayiner 7y ago
It's not quite supported in Rust, as far as I understand it. Say I have two local variables: 'ptr' and 'itr.' 'ptr' is an owning pointer to a region containing a cyclic graph. 'itr' is a pointer to a node in the graph. What is the type of 'itr' in Rust?
- pcwalton 7y agoAssuming you're using a region crate like bumpalo, the type of itr is &'a T, where 'a is the lifetime of ptr. This means that ptr has to be anchored in a stack frame. I haven't looked at Verona specifically, but region systems all have this restriction (for example, ML Kit, the originator of regions, required a lexical "letregion" construct), unless they use dependent types.