-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Implement builtin derive CoercePointee
#18764
Comments
Ok, it looks like this macro does some cursed things no other builtin macro does (adding type parameters, manipulating bounds etc.) which are really awkward to express with our current messy builtin derive infrastructure. This motivates me to look again at simplifying the interaction between the parser and the tt (getting rid of |
I started replacing our current Syntax bridge we won't be getting rid of from what I can tell, I at least don't see why we would as macros don't work on the AST, they work on the token tree model. Either way feel free to pick that PR up if you want. |
I have a sketch of a plan. That is:
The questions I have is whether this will work (of course), but I believe it will. More importantly I'm not sure this is worth it, and I don't know if and how much perf improvements this will bring. This will also cleanup the code (the builtin derives are one big mess currently and On the other hand, I seriously don't know how we can implement |
I think it might be a good idea to step back for a second, clarify the current status quo and check what we can improve more structurally Right now we have the following setup:
That means we currently have two types of syntax trees, our AST (or well, CST) which is what the lowering and the IDE works with and the We should ideally lay out the requirements here to see if we actually need the
Honestly speaking, the last part sounds like what we should just short term. That sounds like what we are doing in the other derives already anyways and the thing does not need to be perfect. That derive is a niche one in the first place and as long as we have some support for it it should be good enough. (the rust for linux folks want it, and they do use rust-analyzer) |
It is about to be stabilized rust-lang/rust#133820
The text was updated successfully, but these errors were encountered: