Closed
Description
An &fn
would be copyable, because the environment would be immutable. The limitations would match the ones placed on regular borrowed pointers (&mut
is moveable, &
is immutable) so I think it would result in a more intuitive system.
This would be required to make #8622 (adding dynamically sized bare function objects) backwards compatible but can be implemented independently and will not be an enormous task. All existing &fn
would become &mut fn
and it will remain the default since &mut
coerces to &
by-move.
Metadata
Metadata
Assignees
Labels
No labels