Loading tutorials
rustdoc turns them into HTML pages. This chapter covers the syntax, what each kind attaches to, and the mistakes people commonly make. Doc tests, links, and the other features have their own chapters.5 min read/// comments, as 6 min read/// comments, know basic Markdown, and can run cargo test --doc. Earlier chapters covered those. Here the focus is the short list of section headings that Rust libraries use to document a function's contract.5 min read/// comments on functions and structs, split a library into modules, and run cargo doc and cargo test --doc. Here you will learn how to document containers, meaning modules and the crate itself, with inner doc comments (//!).5 min read/// and //! comments, you know basic Markdown, and you kn5 min read/// and //! comments, use Markdown inside them, and run cargo build and cargo test on a library crate. Here you will turn those comments into HTML and learn the flags that control the output.6 min readpub functions, run cargo test, and use assert! and assert_eq!. It also assumes you know how to write /// doc comments with Markdown. The examples use a library crate named mycrate.6 min read# prefix, which lets a line be compiled without being displayed. It also covers where the feature goes wrong and how to decide what to hide.6 min read/// doc comments, put a fenced Rust block under an # Examples heading, and run cargo test --doc. By default every Rust block in a doc comment is compiled and run, and the test passes if it finishes without panicking. Some examples can't meet that rule. They m4 min read/// comments, put fenced code blocks in them, and run cargo test --doc. Here you will learn what happens between that command and the pass or fail line. That knowledge explains most surprising doc test failures.6 min read/// comments and fenced examples, and that you know how ? and Result work in ordinary Rust. It covers why ? fails in a doc test, the fixes, and the edge cases that trip people up.5 min read/// and //! comments and run cargo doc and cargo test --doc. It also assumes you know how pub visibility and re-exports (pub use) work. Here you will see what those comments really are, and how the #[doc] attribute controls what rustdoc shows,5 min read/// and //! comments, and use intra-doc links. It also assumes you have seen the # Errors5 min read/// and //! comments, write doc tests, and use intra-doc links. It also assumes you know the missing_docs lint and have run cargo doc and cargo test --doc locally. Here you move those checks into continuous integration (CI) so broken docs fail a build. Yo5 min read