5 ms·
I think the poster to whom you're responding means things like Cell and/or RefCell, which allow mutation behind the scenes while still being safe.
by apta 7y ago
I think the poster to whom you're responding means things like Cell and/or RefCell, which allow mutation behind the scenes while still being safe.
- cyphar 7y agoRight, but I think their main complaint is that RefCell is implemented using "unsafe" -- hence my point about "unsafe".
- apta 7y agoIt's API is not `unsafe` though. Otherwise, every safe API depends on some `unsafe` call down the call graph.
- cyphar 7y agoI think we're both in agreement, I was phrasing things in a manner which I thought would better reference how GP thinks of unsafe. Obviously the API itself is safe, but the "cheating" GP was referring to was the fact that Rust requires "unsafe" under the hood in order to implement some safe operations (because the memory model doesn't cover all cases). You and I agree that this isn't a problem.