reference icon indicating copy to clipboard operation
reference copied to clipboard

Expand `no_builtins` documentation

Open ehuss opened this issue 6 years ago • 2 comments

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?

ehuss avatar Mar 16 '19 19:03 ehuss

Dumping: https://github.com/rust-lang/rust/search?q=no_builtins&unscoped_q=no_builtins

Centril avatar Mar 17 '19 01:03 Centril

Copying some notes from https://github.com/rust-lang/reference/pull/1679.

[!NOTE] Such library functions may include, but are not limited to, C routines such as memcpy or memset.

[!WARNING] A crate using no_builtins does not guarantee that the crate will be free from calls to such functions, even if it does not call the routines explicit. For example, the standard library implementation may still call such functions.

ehuss avatar Sep 30 '25 15:09 ehuss