RFC: Allow pure functions to mutate their &mut
arguments
#3722
Labels
A-lifetimes
Area: Lifetimes / regions
Milestone
&mut
arguments
#3722
Suppose I want to write something like:
This doesn't work because
push_char
isn't pure. Morally, it seems like it should work, though, because althoughpush_char
does modify memory it doesn't own,mk_str
owns the memory and should be allowed to call a function that modifies it.I'm sure this question has come up before, but I don't know if there's an issue on it. If we do keep purity in the language, it seems like it's worth thinking about.
The text was updated successfully, but these errors were encountered: