-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Some hygiene doc improvements #146159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Some hygiene doc improvements #146159
Conversation
13d7600
to
719ecd4
Compare
This comment has been minimized.
This comment has been minimized.
719ecd4
to
0dc3517
Compare
0dc3517
to
07cb420
Compare
There's a couple things I'm still unclear on if you don't mind explaining. In the dev guide section on "The Call-site Hierarchy", it says
But I did some testing and I think If I'm right about the above, is the call-site and the expansion-order hierarchies actually different? I can't think of an example where they would diverge. I noticed when we mark spans for desugaring, we just use the root |
Yes,
Yeah, there's a mistake there, it should be
Yes, they are different, and the example is supposed to demonstrate exactly that.
Using the root |
07cb420
to
31b3915
Compare
/// 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> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is a bit unfortunate since it does not use ExpnData::parent
.
@rustbot ready |
I did some more testing and it seems the SyntaxContext for a Path depends on where the referenced thing is defined...which makes a a of sense. Anyways, I think I've done enough damage here for now. I really appreciate your help with this. |
Improve some doc comments around SyntaxContext, outer_expn and friends.
Based on discussion at #146100.
r? petrochenkov