Is proc_macro crate part of the standard library?

I'm surprised that the proc_macro library is preinstalled for on my computer, but I can't find it alongside other standard libraries. What kind of crate it is that is both preinstalled and not in the std?

What do you mean by "alongside"? It's right here in the source:

And in the distribution, it's part of rust-std installed to $prefix/lib/rustlib/$target/lib/.

I mean it's not the libraries listed here.

It is in the sidebar under "Crates":

1 Like

Yes, then my question is that while it's not listed in the standard library modules, and while it is not third-party, what type of crate/module it is? And why it's listed somewhere else other than the std.

Crates and modules are not the same thing. Of those crates listed in the sidebar, alloc is the only one that also has an equivalent module std::alloc. The contents of core are separately re-exported into relevant std modules, while proc_macro and test are kept entirely separate.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.