Skip to content

NLL diagnostics miss opportunities to suggest "use &mut Type here to make mutable" #51032

Closed
@pnkfelix

Description

@pnkfelix

The following tests rightly suggest under AST borrowck to use a &mut reference in the type, but there is no such suggestion under NLL.

Tests:

  • did_you_mean/issue-38147-1.rs
  • did_you_mean/issue-38147-2.rs
  • did_you_mean/issue-38147-3.rs
  • did_you_mean/issue-38147-4.rs
  • span/borrowck-call-is-borrow-issue-12224.rs
  • span/borrowck-call-method-from-mut-aliasable.rs
  • span/borrowck-fn-in-const-b.rs
  • span/borrowck-object-mutability.rs
  • span/mut-arg-hint.rs

(This list of tests is drawn from an informal paper document that I have been using to keep notes for myself as I work on this...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-NLLArea: Non-lexical lifetimes (NLL)A-diagnosticsArea: Messages for errors, warnings, and lintsNLL-diagnosticsWorking towards the "diagnostic parity" goal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions