]> git.proxmox.com Git - rustc.git/blame - src/doc/nomicon/README.md
New upstream version 1.55.0+dfsg1
[rustc.git] / src / doc / nomicon / README.md
CommitLineData
cc61c64b
XL
1# The Rustonomicon
2
3The Dark Arts of Advanced and Unsafe Rust Programming
4
5Nicknamed "the Nomicon."
6
7## NOTE: This is a draft document, and may contain serious errors
8
416331ca
XL
9> Instead of the programs I had hoped for, there came only a shuddering
10blackness and ineffable loneliness; and I saw at last a fearful truth which no
11one had ever dared to breathe before — the unwhisperable secret of secrets — The
12fact that this language of stone and stridor is not a sentient perpetuation of
13Rust as London is of Old London and Paris of Old Paris, but that it is in fact
cc61c64b
XL
14quite unsafe, its sprawling body imperfectly embalmed and infested with queer
15animate things which have nothing to do with it as it was in compilation.
16
17This book digs into all the awful details that are necessary to understand in
18order to write correct Unsafe Rust programs. Due to the nature of this problem,
19it may lead to unleashing untold horrors that shatter your psyche into a billion
20infinitesimal fragments of despair.
21
136023e0 22## Requirements
cc61c64b
XL
23
24Building the Nomicon requires [mdBook]. To get it:
25
60c5eb7d 26[mdBook]: https://github.com/rust-lang/mdBook
cc61c64b
XL
27
28```bash
136023e0 29cargo install mdbook
cc61c64b
XL
30```
31
416331ca 32### `mdbook` usage
cc61c64b 33
416331ca 34To build the Nomicon use the `build` sub-command:
cc61c64b
XL
35
36```bash
136023e0 37mdbook build
cc61c64b
XL
38```
39
416331ca
XL
40The output will be placed in the `book` subdirectory. To check it out, open the
41`index.html` file in your web browser. You can pass the `--open` flag to `mdbook
42build` and it'll open the index page in your default browser (if the process is
43successful) just like with `cargo doc --open`:
cc61c64b 44
cc61c64b 45```bash
136023e0 46mdbook build --open
cc61c64b
XL
47```
48
416331ca 49There is also a `test` sub-command to test all code samples contained in the book:
cc61c64b
XL
50
51```bash
136023e0
XL
52mdbook test
53```
54
55### `linkcheck`
56
57We use the `linkcheck` tool to find broken links.
58To run it locally:
59
60```sh
61curl -sSLo linkcheck.sh https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
62sh linkcheck.sh --all nomicon
cc61c64b
XL
63```
64
65## Contributing
66
416331ca
XL
67Given that the Nomicon is still in a draft state, we'd love your help! Please
68feel free to open issues about anything, and send in PRs for things you'd like
69to fix or change. If your change is large, please open an issue first, so we can
70make sure that it's something we'd accept before you go through the work of
71getting a PR together.