about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-06-15 09:57:28 +0200
committerGitHub <noreply@github.com>2020-06-15 09:57:28 +0200
commit5193c5d60881e19afdfbab98cbc7ba6b7607ee18 (patch)
tree548621e4e5e97d37bff0f91e704cc6d53f6ab0e8 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parente6510babc786469075f76db94fedfe651072bf25 (diff)
parent9cee22c1a401ace6dd8633335b131c47a37d7bac (diff)
downloadrust-5193c5d60881e19afdfbab98cbc7ba6b7607ee18.tar.gz
rust-5193c5d60881e19afdfbab98cbc7ba6b7607ee18.zip
Rollup merge of #72598 - Aaron1011:feature/fnmut-capture-span, r=nikomatsakis
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/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions