-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Identify non-function annotated by contract in macro expand #138852
base: master
Are you sure you want to change the base?
Conversation
r? @Noratrieb rustbot has assigned @Noratrieb. Use |
Hm, I'm not entirely sure if this is the right fix. The
I'd prefer to see the contract macros do proper parsing by fixing this FIXME here:
instead of adding special cases for them |
Thank you, I will try to fix it in this way. @Noratrieb |
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
@rustbot label -S-waiting-on-author +S-waiting-on-review |
I don't think we should make this token parsing even more complicated than it already is. Either we do a proper AST macro like the other built-in attribute macros, or we'll leave this issue open. It's a very weird edge case, so it's not very important. |
I might have a try. Do you have any suggestions on implementation (such as things to pay attention to)? Or are there some codes and documents to refer to? I have no experience in builtin atrribute macro. @Noratrieb |
I haven't looked much at the code myself, no. Something like the rustc_autodiff macro might be worth looking at, and how it works end-to-end. The rustc dev guide also has some docs on macro expansion. But as I said, it's probably not easy. |
Should I open an issue to track this? |
Closing #137129