Skip to content

MIR-borrowck: dereferences are printed wrapped in parens  #45185

Closed
@pnkfelix

Description

@pnkfelix

MIR-borrowck: In error diagnostics, derefencing expressions are printed with parentheses around them.

For example, for borrowck-borrow-mut-object-twice.rs, AST-borrowck reports:

cannot borrow `*x` as mutable more than once at a time (Ast)

while MIR-borrowck reports:

cannot borrow `(*x)` as mutable more than once at a time (Mir)

(This is hopefully relatively simple to resolve; is there any case where we need the parentheses, given that we already elide dereferences when printing field accessor expressions?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions