about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/coverage/unexpand.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-09-06 07:18:50 +0000
committerbors <bors@rust-lang.org>2024-09-06 07:18:50 +0000
commita3af2085ccdc1890fef22b96397ac58f714c5580 (patch)
treeb89acb130790e38a5958301b1b156c847912bd57 /compiler/rustc_mir_transform/src/coverage/unexpand.rs
parentd678b81485b05680801554d744ea2696949f0135 (diff)
parent11d5614a74ba0da0aeba2848b1b13e9ab2fdee4c (diff)
downloadrust-a3af2085ccdc1890fef22b96397ac58f714c5580.tar.gz
rust-a3af2085ccdc1890fef22b96397ac58f714c5580.zip
Auto merge of #130016 - matthiaskrgr:rollup-fopistw, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #129021 (Check WF of source type's signature on fn pointer cast)
 - #129781 (Make `./x.py <cmd> compiler/<crate>` aware of the crate's features)
 - #129963 (Inaccurate `{Path,OsStr}::to_string_lossy()` documentation)
 - #129969 (Make `Ty::boxed_ty` return an `Option`)
 - #129995 (Remove wasm32-wasip2's tier 2 status from release notes)
 - #130013 (coverage: Count await when the Future is immediately ready )

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src/coverage/unexpand.rs')
-rw-r--r--compiler/rustc_mir_transform/src/coverage/unexpand.rs15
1 files changed, 5 insertions, 10 deletions
diff --git a/compiler/rustc_mir_transform/src/coverage/unexpand.rs b/compiler/rustc_mir_transform/src/coverage/unexpand.rs
index 8cde291b907..cb861544736 100644
--- a/compiler/rustc_mir_transform/src/coverage/unexpand.rs
+++ b/compiler/rustc_mir_transform/src/coverage/unexpand.rs
@@ -1,4 +1,4 @@
-use rustc_span::{ExpnKind, MacroKind, Span, Symbol};
+use rustc_span::{ExpnKind, Span};
 
 /// Walks through the expansion ancestors of `original_span` to find a span that
 /// is contained in `body_span` and has the same [syntax context] as `body_span`.
@@ -13,20 +13,15 @@ pub(crate) fn unexpand_into_body_span(original_span: Span, body_span: Span) -> O
 ///
 /// If the returned span represents a bang-macro invocation (e.g. `foo!(..)`),
 /// the returned symbol will be the name of that macro (e.g. `foo`).
-pub(crate) fn unexpand_into_body_span_with_visible_macro(
+pub(crate) fn unexpand_into_body_span_with_expn_kind(
     original_span: Span,
     body_span: Span,
-) -> Option<(Span, Option<Symbol>)> {
+) -> Option<(Span, Option<ExpnKind>)> {
     let (span, prev) = unexpand_into_body_span_with_prev(original_span, body_span)?;
 
-    let visible_macro = prev
-        .map(|prev| match prev.ctxt().outer_expn_data().kind {
-            ExpnKind::Macro(MacroKind::Bang, name) => Some(name),
-            _ => None,
-        })
-        .flatten();
+    let expn_kind = prev.map(|prev| prev.ctxt().outer_expn_data().kind);
 
-    Some((span, visible_macro))
+    Some((span, expn_kind))
 }
 
 /// Walks through the expansion ancestors of `original_span` to find a span that