-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Proper expansion info for for loops and other compiler expanded language items #25318
Conversation
Why do we want expansion info here? |
Because otherwise the spans are lies - we get a span for parts of the expansions of the for loop which are not what the span is for - i.e., a span for a type which is actually a value in the source. Furthermore, without expansion info you can't tell that the code has been expanded - a tool should assume that the expanded source is the same as the pre-expansion source, which it isn't. |
} | ||
|
||
ast::ExprClosure(capture_clause, fn_decl, block) => { | ||
push_compiler_expansion(fld, span, "closure expansion"); |
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.
Came here from git blame
, was this change accidental?
Closures are not expanded differently from free functions, so they shouldn't require custom expansion stacks.
All that does is pollute diagnostic output IMO.
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.
Yeah, probably wrong
r? @sfackler