Skip to content

no mention of the builtin macro prelude #1834

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

Open
lolbinarycat opened this issue May 26, 2025 · 2 comments
Open

no mention of the builtin macro prelude #1834

lolbinarycat opened this issue May 26, 2025 · 2 comments
Labels
A-macros Area: Macros

Comments

@lolbinarycat
Copy link

The builtin macro prelude is very similar to the language prelude in that it is still available even with no_implicit_prelude, but it differs in that:

  1. it only contains function-style macros
  2. it is not available to no_core crates

It contains macros like option_env and line. A full list is available in library/std/src/lib.rs.

I would like the reference to have a section on them so that rustdoc can provide a banner on builtin macros linking to the reference's section on builtin macros.

@ehuss ehuss added the A-macros Area: Macros label May 26, 2025
@ehuss
Copy link
Contributor

ehuss commented May 29, 2025

Since no_core is not stable, is the existence of this prelude observable by the user? If not, then we probably wouldn't document it. Can you say why rustdoc can't link to the individual macro definitions as-is?

@lolbinarycat
Copy link
Author

I want to link from the definition of builtin macros to a page explaining what builtin macros are.

If we want to ignore the existence of no_core, we could say they're part of the language prelude, but that's not what the reference does currently, currently we treat them as part of the library prelude, which is incorrect, since they are still available even under no_implicit_prelude.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: Macros
Projects
None yet
Development

No branches or pull requests

2 participants