Skip to content

NLL elides type behind a borrow (and its Copy-ness) when reporting move error #51190

Closed
@pnkfelix

Description

@pnkfelix

If you look at the AST-borrowck output for a case like borrowck-vec-pattern-nesting.rs, you see output like this:

error[E0508]: cannot move out of type `[std::boxed::Box<isize>]`, a non-copy slice

but NLL only reports this:

error[E0507]: cannot move out of borrowed content

It is probably useful to include the type behind the borrow (and the fact that it is non-copy) when that is relevant to the move being attempted.

Metadata

Metadata

Assignees

Labels

A-NLLArea: Non-lexical lifetimes (NLL)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