about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-09-03 10:33:06 +0530
committerGitHub <noreply@github.com>2022-09-03 10:33:06 +0530
commitdc8fe633d5812096008d94d47fa692264d327a46 (patch)
tree7c3d92ed9171f0e079166db53dbb8ba3166bcfd1 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parenta0056795da7a51f0ebebf0d5ad8f0b663d089420 (diff)
parentf921f5626d1dcc08f2707ed2c22e22fd1ad678b7 (diff)
downloadrust-dc8fe633d5812096008d94d47fa692264d327a46.tar.gz
rust-dc8fe633d5812096008d94d47fa692264d327a46.zip
Rollup merge of #101217 - eholk:drop-tracking-73137, r=jyn514
[drop tracking] Use parent expression for scope, not parent node

Previously we were just using the parent node as the scope for a temporary value, but it turns out this is too narrow. For example, in an expression like

    Foo {
        b: &42,
        a: async { 0 }.await,
    }

the scope for the &42 was set to the ExprField node for `b: &42`, when we actually want to use the Foo struct expression.

We fix this by recursively searching through parent nodes until we find a Node::Expr. It may be that we don't find one, and if so that's okay, we will just fall back on the enclosing temporary scope which is always sufficient.

Helps with #97331

r? ``@jyn514``
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions