3 ms·
If I can't have escaping closures, I want to be working in C.
by kazinator 9y ago
If I can't have escaping closures, I want to be working in C.
- bombela 9y agoyou can have "escaping" closure. But you cannot return something that outlives it's lifetime. So the closure must own data, not merely refer to it. The online Rust book should habe the details.
- viraptor 9y agoYou can use unsafe if you want to feel like working with C :-) There's nothing stopping you from doing things you know are correct. You just sometimes need to tell the compiler that you know better and guarantee that the code is fine.