Hacker News new | ask | show | jobs
by nitnelave 697 days ago
Deep const: since you have a (const) ref to the variable, you cannot access any of its parts mutably. Of course, RefCell and co are not allowed, I suppose.
1 comments

Internally mutable types are allowed, but doing internal mutation isn't.

So a const function can return a cell, for instance, as long as the cell isn't mutated inside the function.