-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Visitor: remove context and add lifetimes. #17069
Conversation
780ac38
to
26322f6
Compare
cc @pnkfelix |
784d86d
to
5d55f36
Compare
The description above does not make it clear whether the presence of the context conflicted in some fundamental way with the lifetime-threading, or if it was just removed as drive-by code cleanup. (I tried to get clarification about this yesterday from @eddyb but I do not think he understood my question. I do not mind the code cleanup; the fact that the context was so often |
@pnkfelix My bad, I forgot to mention connection between the two changes, though I have to @nikomatsakis before starting work on this. The context did not interfere with lifetime threading, but its removal makes the annotation overhead of lifetimes more bearable. |
Turns out the cost is much smaller, there is no need to annotate methods which mention |
1481aec
to
29b44c6
Compare
(I have to admit, the emulated contexts do not look as bad as I had feared, especially since @eddyb exhibited good taste in factoring the push/pop out into helper methods where appropriate.) |
Few visitors used the context passing feature and it can be easily emulated. The added lifetime threading allows a visitor to keep safe references to AST nodes it visits, making a non-owning ast_map design possible, for #13316.
…icola minor: Fix `rustc_skip_array_during_method_dispatch` edition check CC rust-lang#16450
…icola minor: Fix `rustc_skip_array_during_method_dispatch` edition check CC rust-lang#16450
Few visitors used the context passing feature and it can be easily emulated.
The added lifetime threading allows a visitor to keep safe references to AST
nodes it visits, making a non-owning ast_map design possible, for #13316.