Skip to content

NLL fails to suggest using ref when a pattern is otherwise an impossible move #51189

Closed
@pnkfelix

Description

@pnkfelix

In the case of ui/borrowck/borrowck-move-error-with-note.rs, the AST borrowck output (borrowck-move-error-with-note.stderr) includes suggestions like this:

LL |         Foo::Foo1(num1,
   |                   ---- hint: to prevent move, use `ref num1` or `ref mut num1`

but NLL (borrowck-move-error-with-note.nll.stderr) presents no such suggestion for errors it discovers in the MIR for match patterns.

Here are all the tests that I think involve this:

Metadata

Metadata

Assignees

Labels

NLL-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