Skip to content

Weird async/await error message around mutablility #51932

@cramertj

Description

@cramertj

Attempting to mutate an argument to an async fn that was not marked mut results in this error message:
cannot borrow immutable captured outer variable in an `FnOnce` closure `sender` as mutable

This is obviously subpar 😆

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-async-awaitArea: Async & AwaitA-borrow-checkerArea: The borrow checkerA-diagnosticsArea: Messages for errors, warnings, and lintsAsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions