Skip to content

Error messages in report_use_of_moved_value() should be more intelligent. #7286

Closed
@bblum

Description

@bblum

Currently it knows how to emit three possible error messages:

`%s` moved here because it has type `%s`, which is moved by default (use `copy` to override)
`%s` moved here because it has type `%s`, which is moved by default (use `ref` to override)
`%s` moved into closure environment here because its type is moved by default
(make a copy and capture that instead to override)

But there are several situations in which the hints are wrong -- if the type is completely noncopyable, the phrase "moved by default ([hint])" should just be "noncopyable". And, if the type is a stack closure, I'd like it to emit a hint like "Suggest implicitly borrowing the closure with |args...| closure(args...)".

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-type-systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions