Expand `no_builtins` documentation

Open
#542 2 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Review the Reference documentation for the no_builtins attribute and the rustc Book as proposed. Clarify its purpose, behavior, examples, and LTO interaction, then decide which details belong in each location and add a link between them. Done means the documentation answers the stated usage and behavior questions without cataloguing every builtin.

Written by the indexing model from the issue text.

Description

A-attributes

Should there be more documentation explaining what the no_builtins attribute does?

I gather it disables LLVM builtin functions, but it's not clear to me what it uses instead. Does it use libc? Does it fail to compile?

I suspect it's not worth documenting the list of builtins, but maybe some examples would be helpful. Perhaps along with some indication why it would be used?

When enabled, it also prevents the crate from participating in LTO.

Some of this seems like implementation details, so I'm not sure what should be documented. I think optimization or backend codegen details should probably be kept in The rustc Book, so maybe it could be documented there, and just have a link to it from the reference?

Dominant language
Rust
Stars
1.6k
Forks
607
Avg merge
1d 1h
Merged PRs (30d)
12

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.

More from rust-lang/reference

All issues in rust-lang/reference

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.