diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2021-04-18 14:27:04 +0200 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-09-10 20:17:33 +0200 |
| commit | 00485e0c0e8dcd64c57a86d706beb62054921253 (patch) | |
| tree | d5920e5354a86ea0180d39f7068029f0a33bc296 /compiler/rustc_mir_transform/src/coverage | |
| parent | 06f7ca307d7ffdbdafe05eb76cc850eaf716916d (diff) | |
| download | rust-00485e0c0e8dcd64c57a86d706beb62054921253.tar.gz rust-00485e0c0e8dcd64c57a86d706beb62054921253.zip | |
Keep a parent LocalDefId in SpanData.
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage')
| -rw-r--r-- | compiler/rustc_mir_transform/src/coverage/spans.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/spans.rs b/compiler/rustc_mir_transform/src/coverage/spans.rs index 2ea2e06029d..cc525a4d6b9 100644 --- a/compiler/rustc_mir_transform/src/coverage/spans.rs +++ b/compiler/rustc_mir_transform/src/coverage/spans.rs @@ -196,7 +196,11 @@ impl CoverageSpan { /// body_span), returns the macro name symbol. pub fn visible_macro(&self, body_span: Span) -> Option<Symbol> { if let Some(current_macro) = self.current_macro() { - if self.expn_span.parent().unwrap_or_else(|| bug!("macro must have a parent")).ctxt() + if self + .expn_span + .parent_callsite() + .unwrap_or_else(|| bug!("macro must have a parent")) + .ctxt() == body_span.ctxt() { return Some(current_macro); |
