about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2020-05-23 21:40:55 -0400
committerAaron Hill <aa1ronham@gmail.com>2020-05-25 23:18:00 -0400
commit9cee22c1a401ace6dd8633335b131c47a37d7bac (patch)
treec1b624432b2eaf240062d1febe0ca729609ff823 /src/test/codegen/src-hash-algorithm
parentf93bb2a50b37bc8bafe4d960e2afd839eaa854ed (diff)
downloadrust-9cee22c1a401ace6dd8633335b131c47a37d7bac.tar.gz
rust-9cee22c1a401ace6dd8633335b131c47a37d7bac.zip
Display information about captured variable in `FnMut` error
Fixes #69446

When we encounter a region error involving an `FnMut` closure, we
display a specialized error message. However, we currently do not
tell the user which upvar was captured. This makes it difficult to
determine the cause of the error, especially when the closure is large.

This commit records marks constraints involving closure upvars
with `ConstraintCategory::ClosureUpvar`. When we decide to 'blame'
a `ConstraintCategory::Return`, we additionall store
the captured upvar if we found a `ConstraintCategory::ClosureUpvar` in
the path.

When generating an error message, we point to relevant spans if we have
closure upvar information available. We further customize the message if
an `async` closure is being returned, to make it clear that the captured
variable is being returned indirectly.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions