rust/src/doc
Jørn Lode c08deef982 Rustonomicon: Fix bug in implementation of Vec::drain()
In the last code snippet on the following page there is a bug in the
implementation of Vec::drain().

https://doc.rust-lang.org/nightly/nomicon/vec-drain.html

```rust
pub fn drain(&mut self) -> Drain<T> {
    // Oops, setting it to 0 while we still need the old value!
    self.len = 0;

    unsafe {
        Drain {
            // len is used to create a &[T] from &self here,
            // so we end up always creating an empty slice.
            iter: RawValIter::new(&self),
            vec: PhantomData,
        }
    }
}
```

A simple test to verify that Drain is broken can be found here:
https://play.rust-lang.org/?gist=30f579565e4bbf4836ce&version=nightly

And here's one with a fixed implementation:
https://play.rust-lang.org/?gist=2ec0c1a6dcf5defd7a53&version=nightly
2015-09-06 03:44:13 +02:00
..
nomicon Rustonomicon: Fix bug in implementation of Vec::drain() 2015-09-06 03:44:13 +02:00
style Tweak style guide to avoid referencing the removed ascii::Ascii. 2015-08-09 18:56:48 -07:00
trpl Rollup merge of #28225 - jackwilsonv:patch-3, r=steveklabnik 2015-09-05 16:16:01 +05:30
complement-design-faq.md Update complement-design-faq.md 2015-06-30 17:02:10 -03:00
complement-lang-faq.md Add Terminal.com to the list of companies using rust in production. 2015-06-11 16:07:34 -07:00
complement-project-faq.md
favicon.inc Use https URLs to refer to rust-lang.org where appropriate. 2015-08-09 14:28:46 -07:00
footer.inc Convert playpen.js to plain JS. 2015-06-12 16:26:07 -04:00
full-toc.inc
grammar.md Rollup merge of #28215 - matklad:grammar-extern-block-item, r=steveklabnik 2015-09-03 20:10:09 -04:00
guide-crates.md
guide-error-handling.md
guide-ffi.md
guide-macros.md
guide-ownership.md
guide-plugins.md
guide-pointers.md Change removal notice for pointer guide. 2015-06-29 15:18:00 -04:00
guide-strings.md
guide-tasks.md
guide-testing.md
guide-unsafe.md
guide.md
index.md Updated the link with rendered version of the Spanish trpl translation. 2015-08-11 11:02:38 +01:00
intro.md Remove the 30 minute intro 2015-04-18 17:55:31 -04:00
not_found.md Use https URLs to refer to rust-lang.org where appropriate. 2015-08-09 14:28:46 -07:00
README.md doc/readme: replace references to Pandoc with rustdoc. 2015-08-12 22:29:05 -04:00
reference.md Removed incorrect reference from #28196 2015-09-03 14:39:34 -07:00
rust.css Move wrapper types blog post into trpl 2015-07-25 11:02:41 +05:30
rust.md
rustdoc.md
tutorial.md
uptack.tex
version_info.html.template Use https URLs to refer to rust-lang.org where appropriate. 2015-08-09 14:28:46 -07:00

Rust documentations

Building

To generate all the docs, just run make docs from the root of the repository. This will convert the distributed Markdown docs to HTML and generate HTML doc for the 'std' and 'extra' libraries.

To generate HTML documentation from one source file/crate, do something like:

rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs

(This, of course, requires a working build of the rustdoc tool.)

Additional notes

To generate an HTML version of a doc from Markdown manually, you can do something like:

rustdoc reference.md

(reference.md being the Rust Reference Manual.)

An overview of how to use the rustdoc command is available in the docs. Further details are available from the command line by with rustdoc --help.