Skip to content

Changing mutable borrow check error when it occurs in a loop #2080

Closed
@ivanbakel

Description

@ivanbakel

I'm happy to write up a full RFC for this, but I'd prefer to float the idea and understand if more contextual messages are a good thing. Inspired by my own experience in rust-lang/rust#43437, the message for two mutable borrows doesn't account for the case of loops - producing an error message that looks strange and doesn't really communicate what the borrow checker is having a problem with.

I'd like to change it so that the formatted message is changed based on it occuring inside a loop, similar to the use of moved value error message, which specifies when the move occurs in a loop iteration.

The code is already written, in ivanbakel/rust@53fb2a5 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions