Skip to content

split &fn into &fn and &mut fn #8633

Closed
Closed
@thestinger

Description

@thestinger

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions