Bad error message using shared borrow of non-sync type across await point #71010
Labels
A-async-await
Area: Async & Await
A-diagnostics
Area: Messages for errors, warnings, and lints
A-traits
Area: Trait system
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-async
Working group: Async & await
I tried this code:
I expected to see this happen: one of three things:
foo
branch doesn't compile, butbar
branch does, and error message explains that&T
is non-sync while&mut T
is syncwhere T: !Sync
Instead, this happened: explanation
foo
branch doesn't compile, butbar
branch does, error message implies that the error is a lifetime issue rather than related to shared vs exclusive borrowing.Meta
I ran this code using the latest stable (1.42.0) and nightly (1.44.0-nightly (2020-04-09 94d3463)) versions of the compiler. Same error message occurs both times.
The text was updated successfully, but these errors were encountered: