about summary refs log tree commit diff
path: root/src/doc
AgeCommit message (Collapse)AuthorLines
2019-03-09Rollup merge of #58626 - QuietMisdreavus:doc-coverage, r=GuillaumeGomezMazdak Farrokhzad-4/+31
rustdoc: add option to calculate "documentation coverage" This PR adds a new flag to rustdoc, `--show-coverage`. When passed, this flag will make rustdoc count the number of items in a crate with documentation instead of generating docs. This count will be output as a table of each file in the crate, like this (when run on my crate `egg-mode`): ``` +-------------------------------------+------------+------------+------------+ | File | Documented | Total | Percentage | +-------------------------------------+------------+------------+------------+ | src/auth.rs | 16 | 16 | 100.0% | | src/common/mod.rs | 1 | 1 | 100.0% | | src/common/response.rs | 9 | 9 | 100.0% | | src/cursor.rs | 24 | 24 | 100.0% | | src/direct/fun.rs | 6 | 6 | 100.0% | | src/direct/mod.rs | 41 | 41 | 100.0% | | src/entities.rs | 50 | 50 | 100.0% | | src/error.rs | 27 | 27 | 100.0% | | src/lib.rs | 1 | 1 | 100.0% | | src/list/fun.rs | 19 | 19 | 100.0% | | src/list/mod.rs | 22 | 22 | 100.0% | | src/media/mod.rs | 27 | 27 | 100.0% | | src/place/fun.rs | 8 | 8 | 100.0% | | src/place/mod.rs | 35 | 35 | 100.0% | | src/search.rs | 26 | 26 | 100.0% | | src/service.rs | 74 | 74 | 100.0% | | src/stream/mod.rs | 49 | 49 | 100.0% | | src/tweet/fun.rs | 15 | 15 | 100.0% | | src/tweet/mod.rs | 73 | 73 | 100.0% | | src/user/fun.rs | 24 | 24 | 100.0% | | src/user/mod.rs | 87 | 87 | 100.0% | +-------------------------------------+------------+------------+------------+ | Total | 634 | 634 | 100.0% | +-------------------------------------+------------+------------+------------+ ``` Trait implementations are not counted because by default they "inherit" the docs from the trait, even though an impl can override those docs. Similarly, inherent impl blocks are not counted at all, because for the majority of cases such docs are not useful. (The usual pattern for inherent impl blocks is to throw all the methods on a type into a single impl block. Any docs you would put on that block would be better served on the type itself.) In addition, `--show-coverage` can be combined with `--document-private-items` to get the coverage counts for everything in the crate, not just public items. The coverage calculation is implemented as a late pass and two new sets of passes which strip out most of the work that rustdoc otherwise does when generating docs. The is because after the new pass is executed, rustdoc immediately closes instead of going on to generate documentation. Many examples of coverage calculations have been included as `rustdoc-ui` tests. r? @rust-lang/rustdoc
2019-03-08Update booksEric Huss-0/+0
2019-03-01Auto merge of #58800 - ehuss:update-books, r=Centrilbors-0/+0
Update edition-guide 15 commits in 419edb885ec1a98c0747b3907003d79e3e6b93a9..5f3cc2a5618700efcde3bc00799744f21fa9ad2e 2018-12-04 16:43:38 -0500 to 2019-02-27 20:11:50 -0800 - Migrate to mdbook 0.2. (rust-lang-nursery/edition-guide#152) - Remove automatic deployment. (rust-lang-nursery/edition-guide#151) - Fix issue with rust's linkchecker and mdbook. (rust-lang-nursery/edition-guide#147) - Fix test now that overflowing_literals is rejected in all editions. (rust-lang-nursery/edition-guide#148) - overflowing_literals is deny on all editions (rust-lang-nursery/edition-guide#146) - Update for uniform_path stabilization. (rust-lang-nursery/edition-guide#141) - Add example to rustup to show overriding to specific version (rust-lang-nursery/edition-guide#144) - Update for anonymous-lifetime stabilization. (rust-lang-nursery/edition-guide#142) - Add minimum Rust version for Kleene operator (rust-lang-nursery/edition-guide#137) - Add 2018-specific changes. (rust-lang-nursery/edition-guide#130) - aborting-on-panic.md: Typo in example config (rust-lang-nursery/edition-guide#125) - Clarify uniform paths are not yet in Rust 2018 (rust-lang-nursery/edition-guide#124) - update several version numbers - Fixes outdated link (rust-lang-nursery/edition-guide#131) - Fixed typo in transitioning page. (rust-lang-nursery/edition-guide#127)
2019-02-28tweak docs for rustdoc's `--show-coverage`QuietMisdreavus-4/+8
2019-02-28update docs for doc coverageQuietMisdreavus-2/+4
2019-02-28tabs -> spacesQuietMisdreavus-4/+4
2019-02-28add option to calculate documentation coverageQuietMisdreavus-0/+21
2019-02-27Update edition-guideEric Huss-0/+0
2019-02-27Add c_variadic to the unstable-bookDan Robertson-0/+50
- Add the c_variadic language feature - Add the c_variadic library feature
2019-02-27Auto merge of #58709 - kornelski:book, r=QuietMisdreavusbors-0/+0
Update book submodule Updates the book to the latest commit This is to include [documentation SEO fix](https://github.com/rust-lang/book/pull/1788) ASAP.
2019-02-25Update book submoduleKornel-0/+0
2019-02-25Rollup merge of #55632 - ollie27:deny_overflowing_literals, r=CentrilMazdak Farrokhzad-20/+20
Deny the `overflowing_literals` lint for all editions The `overflowing_literals` was made deny by default for the 2018 edition by #54507, however I'm not aware of any reason it can't be made deny by default for the 2015 edition as well.
2019-02-20fix typoAndre Bogus-1/+1
2019-02-20Rollup merge of #58544 - TheBiggerGuy:rustc-doc-cli-args, r=TimNNkennytm-2/+2
Fix doc for rustc "-g" flag The rustc `-g` CLI flag was miss documented to be a synonym of `-C debug-level=2` and not `-C debuglevel=2`. Also add links to the codegen docs for each synonym. I am unsure of this will conflict with work on #52938
2019-02-20Rollup merge of #58534 - dwijnand:mention-capping-forbid-lints, r=oli-obkkennytm-1/+3
Mention capping forbid lints I felt the description of forbid was misleading/incomplete without mentioning how --cap-lints interacts with it.
2019-02-20Rollup merge of #56470 - llogiq:process-termination-doctest, r=GuillaumeGomezkennytm-0/+17
Modify doctest's auto-`fn main()` to allow `Result`s This lets the default `fn main()` ~~return `impl Termination`~~ unwrap Results, which allows the use of `?` in most tests without adding it manually. This fixes #56260 ~~Blocked on `std::process::Termination` stabilization.~~ Using `Termination` would have been cleaner, but this should work OK.
2019-02-17Add links to codegen docs for rustc synonym flagsGuy Taylor-2/+2
The rustc "-g" and "-o" fags are synonyms of the "-c" codegen flags. This adds a link to the codegen docs for each synonym.
2019-02-17Fix doc for rustc "-g" flagGuy Taylor-1/+1
The rustc "-g" CLI flag was miss documented to be a synonym of "-C debug-level=2" and not the correct "-C debuginfo=2".
2019-02-17Modify doctest's auto-`fn main()` to allow `Result`sAndre Bogus-0/+17
This lets the default `fn main()` unwrap any `Result`s, which allows the use of `?` in most tests without adding it manually.
2019-02-17Mention capping forbid lintsDale Wijnand-1/+3
I felt the description of forbid was misleading/incomplete without mentioning how --cap-lints interacts with it.
2019-02-14Rollup merge of #57856 - lzutao:fix-old-first-edition, r=steveklabnikMazdak Farrokhzad-4/+4
Convert old first edition links to current edition one r? @steveklabnik
2019-02-13Convert old doc links to current editionLzu Tao-4/+4
Use footnote style to bypass the tidy check
2019-02-12Add documentation about -Clinker-plugin-lto to rustc book.Michael Woerister-1/+110
2019-02-10Rollup merge of #58350 - petrochenkov:embed, r=frewsxcvGuillaume Gomez-0/+0
Fix failing tidy (line endings on Windows) Updates to `embedded-book` including https://github.com/rust-embedded/book/pull/127.
2019-02-10Fix failing tidy (line endings on Windows)Vadim Petrochenkov-0/+0
2019-02-09Some writing improvement, conciseness of introRobert Hayek-4/+3
2019-02-07Auto merge of #57998 - niklasf:align-enum, r=nagisabors-0/+42
Allow #[repr(align(x))] on enums (#57996) Tracking issue: #57996 Implements an extension of [RFC 1358](https://github.com/rust-lang/rfcs/blob/master/text/1358-repr-align.md) behind a feature flag (`repr_align_enum`). Originally introduced here for structs: #39999. It seems like only HIR-level changes are required, since enums are already aware of their alignment (due to alignment of their limbs). cc @bitshifter
2019-02-05Add Rustlings to the doc indexliv-0/+6
2019-02-04Update embedded book dependencyJames Munns-0/+0
2019-02-04Add embedded bookJames Munns-0/+16
2019-01-31Clarify semantics of #[repr(align(x))] on enumsNiklas Fiekas-0/+16
2019-01-30Allow #[repr(align(x))] on enums (#57996)Niklas Fiekas-0/+26
2019-01-29Add link to the edition guide.Siddhartha Sahu-0/+4
2019-01-27Change generator trait to use pinningWim Looman-13/+18
2019-01-26Change crate-visibility-modifier issue number in The Unstable BookHirokazu Hata-2/+2
2019-01-24Remove quote_*! macros and associated APIsMark Simulacrum-1/+2
2019-01-21Auto merge of #55045 - kleimkuhler:add-std-is_sorted, r=KodrAusbors-0/+11
Add `is_sorted` to `Iterator` and `[T]` This is an initial implementation for the first step of [RFC 2351](https://github.com/rust-lang/rfcs/blob/master/text/2351-is-sorted.md) Tracking issue: https://github.com/rust-lang/rust/issues/53485
2019-01-18Rollup merge of #57212 - phansch:improve_rustc_book_contributing, r=steveklabnikMazdak Farrokhzad-1/+7
docs(rustc): Link to the book's source in rustc This makes the source of [the rustc book](https://doc.rust-lang.org/rustc/what-is-rustc.html) book a bit more discoverable.
2019-01-18Rollup merge of #57132 - daxpedda:master, r=steveklabnikMazdak Farrokhzad-1/+1
Document that `-C opt-level=0` implies `-C debug-assertions`. I couldn't find it stated anywhere else (https://doc.rust-lang.org/nightly/rustc/codegen-options/index.html#opt-level). It was a problem before here: https://github.com/rust-lang/rust/issues/39449, it got lost in the migration to the new documentation I assume. On a sidenote: I think that `-C opt-level=0` having a sideeffect on another flag should be changed. Having compiler flags affecting others doesn't make much sense to me, they are used to fine tune anyway. In any case, this plays no role in this PR.
2019-01-17Add is_sorted unstable documentationKevin Leimkuhler-0/+11
2019-01-17Bless test.Wesley Norris-1/+9
Bless test, remove submodule, and fix book entry. bless test again? maybe it'll work this time...
2019-01-17Add book section and fix typo.Wesley Norris-0/+4
2019-01-17Deny the `overflowing_literals` lint for all editionsOliver Middleton-20/+20
2019-01-17Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrumbors-0/+0
Add lint for copyright headers to 'tidy' tool r? @Mark-Simulacrum CC @centril
2019-01-16Updated Book and Reference submodules.Alexander Regueiro-0/+0
2019-01-14Rollup merge of #57572 - Centril:unaccept-extern-in-path, r=petrochenkovMazdak Farrokhzad-40/+0
Unaccept `extern_in_paths` Based on completed fcp-close in https://github.com/rust-lang/rust/issues/55600, this removes `extern_in_path` (e.g. `extern::foo::bar`) from the language. The changes are primarily reversing https://github.com/rust-lang/rust/commit/32db83b16e06cb5cca72d0e6a648a8008eda0fac. Closes https://github.com/rust-lang/rust/issues/55600 r? @petrochenkov
2019-01-13remove extern_in_paths.Mazdak Farrokhzad-40/+0
2019-01-13Update the const fn tracking issue to the new metabugvarkor-2/+2
2019-01-12Stabilise irrefutable if-let and while-let patternsvarkor-28/+0
This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495). Co-Authored-By: Sebastian Malton <sebastian@malton.name>
2019-01-08stabilise cfg_attrdylan_DPC-20/+0