about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2020-08-25 23:58:58 -0400
committerAaron Hill <aa1ronham@gmail.com>2020-08-26 02:11:01 -0400
commitb5b8b9329b3a118879bad6c476612d49f89461a3 (patch)
tree68c127601f328aea74f2d4b6e70311ad2bbf30a9 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parentbf4342114e357f2934d59e12e31e94532ddb2adf (diff)
downloadrust-b5b8b9329b3a118879bad6c476612d49f89461a3.tar.gz
rust-b5b8b9329b3a118879bad6c476612d49f89461a3.zip
Point to a move-related span when pointing to closure upvars
Fixes #75904

When emitting move/borrow errors, we may point into a closure to
indicate why an upvar is used in the closure. However, we use the
'upvar span', which is just an arbitrary usage of the upvar. If the
upvar is used in multiple places (e.g. a borrow and a move), we may end
up pointing to the borrow. If the overall error is a move error, this
can be confusing.

This PR tracks the span that caused an upvar to become captured by-value
instead of by-ref (assuming that it's not a `move` closure). We use this
span instead of the 'upvar' span when we need to point to an upvar usage
during borrow checking.
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions