about summary refs log tree commit diff
path: root/compiler/rustc_span/src/lib.rs
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-09-13 18:55:16 -0400
committerGitHub <noreply@github.com>2025-09-13 18:55:16 -0400
commit4ee860f6b83f25082cd5c62ed504d51ca7087166 (patch)
tree3dcdc343aec3ef2fcfabd10049cbf280fab74d00 /compiler/rustc_span/src/lib.rs
parente9c80c733e1488906995f2fc22c928b7f2f82451 (diff)
parent31b39150c79e77cbde2d0567120977a014c224f8 (diff)
downloadrust-4ee860f6b83f25082cd5c62ed504d51ca7087166.tar.gz
rust-4ee860f6b83f25082cd5c62ed504d51ca7087166.zip
Rollup merge of #146159 - camsteffen:hygiene-docs, r=petrochenkov
Some hygiene doc improvements

Improve some doc comments around SyntaxContext, outer_expn and friends.

Based on discussion at https://github.com/rust-lang/rust/pull/146100.

r? petrochenkov
Diffstat (limited to 'compiler/rustc_span/src/lib.rs')
-rw-r--r--compiler/rustc_span/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs
index ae6755f0764..e95b743b1ce 100644
--- a/compiler/rustc_span/src/lib.rs
+++ b/compiler/rustc_span/src/lib.rs
@@ -710,8 +710,8 @@ impl Span {
         if !ctxt.is_root() { ctxt.outer_expn_data().call_site.source_callsite() } else { self }
     }
 
-    /// The `Span` for the tokens in the previous macro expansion from which `self` was generated,
-    /// if any.
+    /// Returns the call-site span of the last macro expansion which produced this `Span`.
+    /// (see [`ExpnData::call_site`]). Returns `None` if this is not an expansion.
     pub fn parent_callsite(self) -> Option<Span> {
         let ctxt = self.ctxt();
         (!ctxt.is_root()).then(|| ctxt.outer_expn_data().call_site)