rust-lang / rust-lang/reference

no mention of the builtin macro prelude

Open
#1,834 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-macros
Dominant language
Rust
Stars
1.6k
Forks
607
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the builtin macro list in library/std/src/lib.rs and inspect the Rust Reference's existing prelude and macro sections. Document that the builtin macro prelude remains available with no_implicit_prelude, is limited to function-style macros, and is unavailable to no_core crates. Done means the reference has a dedicated section that rustdoc can link to for builtin macro banners.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.