Skip to content
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

关于本书中过程宏部分描述的更新建议 #1512

Open
WowYouCanReallyDance opened this issue Jan 27, 2025 · 0 comments
Open

关于本书中过程宏部分描述的更新建议 #1512

WowYouCanReallyDance opened this issue Jan 27, 2025 · 0 comments

Comments

@WowYouCanReallyDance
Copy link

WowYouCanReallyDance commented Jan 27, 2025

作者大大,有个地方我觉得可以明晰一下,就是cargo的最小编译单元是crate(箱),过程宏必须至少放在一个library crate中。
包也就是package是crate的上级组织结构。
其实proc-macro是可以和普通代码共存于同一个package中的,只是proc-macro代码必须放在单独的library crate中。

对应本书该描述部分的引用
https://course.rs/advance/macro.html#用过程宏为属性标记生成代码

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant