about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-10 12:43:43 +0000
committerbors <bors@rust-lang.org>2024-08-10 12:43:43 +0000
commit37f98fffe7283c823cf25a2ea3183000272e6f68 (patch)
tree657d642f42b37f07b5edcb1525deddbb5d63e2ab /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent780c61f1ee665a70d1abb563c22b96ee43d5f78e (diff)
parent234a1d35d9f1acc1da25b5069908ca2de209d322 (diff)
downloadrust-37f98fffe7283c823cf25a2ea3183000272e6f68.tar.gz
rust-37f98fffe7283c823cf25a2ea3183000272e6f68.zip
Auto merge of #13220 - y21:issue13219, r=dswij
[`macro_metavars_in_unsafe`]: recognize metavariables in tail expressions

Fixes #13219

`macro_metavars_in_unsafe` keeps track of the current "expansion depth" (incremented/decremented when entering/leaving a macro span) to tell if an expression from the root context is contained within a macro (see the doc comment I added for a hopefully better explanation)

Before this PR, we didn't increment said `expn_depth` for `unsafe` blocks within macros, because we already do that in `visit_stmt` anyway, so it would work fine for statements, but that's not enough for tail expressions of an unsafe block.

So we now also increment it for macro unsafe blocks.
Also updated the comment for `expn_depth` while I'm at it because "This is not necessary for correctness" isn't correct now that I think about it

------

changelog: none
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions