diff options
| author | Eric Holk <ericholk@microsoft.com> | 2022-08-30 15:17:45 -0700 |
|---|---|---|
| committer | Eric Holk <ericholk@microsoft.com> | 2022-08-30 15:17:45 -0700 |
| commit | b9d3f654128ce6ba29e1e9ff31fcc44f2f04b59f (patch) | |
| tree | 97badec6bf25b1c3e4c84453d6e09f44ee1e93aa /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp | |
| parent | 230a8ee364b693c286a2187e56239cd2cc3be318 (diff) | |
| download | rust-b9d3f654128ce6ba29e1e9ff31fcc44f2f04b59f.tar.gz rust-b9d3f654128ce6ba29e1e9ff31fcc44f2f04b59f.zip | |
[drop tracking] Use parent expression for scope
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.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
