34 ms·
I’d just like to say, don’t feel bad. The responses you’ve received aren’t particularly kind and as a rust user, I’m sorry for that. It’s entirely fair to say
by wokwokwok 5y ago
I’d just like to say, don’t feel bad.
The responses you’ve received aren’t particularly kind and as a rust user, I’m sorry for that.
It’s entirely fair to say you don’t understand why it’s not possible to have self referential structs, because it is possible;
If you have raw pointers you can have self referential types... so why not refs?
The issue here is that, like references passed to closures, the type checker isn’t sophisticated enough to track the references and ensure things are correct.
You could very plausibly have a struct in the form described above where moving ‘phrase’ is forbidden until the vec is cleared.
You can literally do that inside a function.
So... the problem here is the rust compiler, and that it’s difficult to implement.