about summary refs log tree commit diff
path: root/src/bootstrap/doc.rs
AgeCommit message (Collapse)AuthorLines
2022-03-28bootstrap: better error message for no_std docsEric Huss-0/+6
2022-03-05Merge build_helper into utilbjorn3-2/+1
2022-03-05Remove build_helperbjorn3-3/+2
The majority of the code is only used by either rustbuild or rustc_llvm's build script. Rust_build is compiled once for rustbuild and once for every stage. This means that the majority of the code in this crate is needlessly compiled multiple times. By moving only the code actually used by the respective crates to rustbuild and rustc_llvm's build script, this needless duplicate compilation is avoided.
2022-01-21allow excluding paths only from a single modulePietro Albini-4/+4
x.py has support for excluding some steps from the invocation, but unfortunately that's not granular enough: some steps have the same name in different modules, and that prevents excluding only *some* of them. As a practical example, let's say you need to run everything in `./x.py test` except for the standard library tests, as those tests require IPv6 and need to be executed on a separate machine. Before this commit, if you were to just run this: ./x.py test --exclude library/std ...the execution would fail, as that would not only exclude running the tests for the standard library, it would also exclude generating its documentation (breaking linkchecker). This commit adds support for an optional module annotation in --exclude paths, allowing the user to choose which module to exclude from: ./x.py test --exclude test::library/std This maintains backward compatibility, but also allows for more ganular exclusion. More examples on how this works: | `--exclude` | Docs | Tests | | ------------------- | ------- | ------- | | `library/std` | Skipped | Skipped | | `doc::library/std` | Skipped | Run | | `test::library/std` | Run | Skipped | Note that the new behavior only works in the `--exclude` flag, and not in other x.py arguments or flags yet.
2021-11-08Make `compiler-docs` only control the default instead of being a hard off-switchJoshua Nelson-12/+3
This also fixes `x doc src/tools/clippy` when compiler-docs is disabled.
2021-10-28Document clippy on nightly-rustcxFrednet-0/+1
2021-09-27Auto merge of #89182 - GuillaumeGomez:boostrap-explicit-request, ↵bors-17/+14
r=Mark-Simulacrum Simplify explicit request check and allow to run "doc src/librustdoc" even without config set Originally I wanted to allow the command `doc src/librustdoc` to work when passed explicitly but then `@Mark-Simulacrum` recommended me to generalize it, so here we are! r? `@Mark-Simulacrum`
2021-09-24Enable "generate-link-to-definition" option on rust tools docs as wellGuillaume Gomez-0/+1
2021-09-24Simplify explicit request checkGuillaume Gomez-17/+14
2021-09-17Rollup merge of #88666 - GuillaumeGomez:compiler-docs, r=Mark-SimulacrumGuillaume Gomez-10/+53
Improve build command for compiler docs It was rather complicated to document rustc crates. With this, you can directly run: ```console x.py doc compiler x.py doc compiler/rustc_hir_pretty ``` The second commit adds the handling of the `--open` flag. r? `@Mark-Simulacrum`
2021-09-17Correctly handle "--open" option when building compiler docsGuillaume Gomez-0/+9
2021-09-17Allow to pass "compiler" arguments to doc subcommandGuillaume Gomez-10/+44
2021-09-16Enable rustdoc's --generate-link-to-definition for rustc docsGiacomo Stevanato-0/+1
2021-09-11explicitly link to external `ena` docslcnr-0/+8
2021-08-16Document private items for rustfmtJoshua Nelson-12/+3
This is possible now that rustdoc allows passing `--document-private-items` more than once.
2021-07-20Update all submodules that rustbuild doesn't depend on lazilyJoshua Nelson-10/+29
This only updates the submodules the first time they're needed, instead of unconditionally the first time you run x.py. Ideally, this would move *all* submodules and not exclude some tools and backtrace. Unfortunately, cargo requires all `Cargo.toml` files in the whole workspace to be present to build any crate. On my machine, this takes the time for an initial submodule clone (for `x.py --help`) from 55.70 to 15.87 seconds. This uses exactly the same logic as the LLVM update used, modulo some minor cleanups: - Use a local variable for `src.join(relative_path)` - Remove unnecessary arrays for `book!` macro and make the macro simpler to use - Add more comments
2021-07-07Document rustdoc with `--document-private-items`Justus K-4/+10
2021-07-05Auto merge of #86663 - fee1-dead:use-rustdoc-css, r=GuillaumeGomezbors-2/+8
Use rustdoc.css for error index Closes #86512.
2021-07-01Document rustfmt on nightly-rustcJoshua Nelson-5/+11
The recursion_limit attribute avoids the following error: ``` error[E0275]: overflow evaluating the requirement `std::ptr::Unique<rustc_ast::Pat>: std::marker::Send` | = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`rustfmt_nightly`) ```
2021-06-29Use a macro for documenting rustdocJoshua Nelson-67/+74
2021-06-28Add new tool to check HTML:Guillaume Gomez-2/+2
* Make html-checker run by default on rust compiler docs as well * Ensure html-checker is run on CI * Lazify tidy binary presence check
2021-06-28Make every standalone doc use rustdoc.cssDeadbeef-2/+8
2021-05-24Bootstrap: skip rustdoc fingerprint for building docs.Eric Huss-0/+3
2021-05-15Rollup merge of #85185 - ↵Guillaume Gomez-9/+22
GuillaumeGomez:generate-not-more-docs-than-necessary, r=Mark-Simulacrum Generate not more docs than necessary This is something that `@Nemo157` was talking about: they wanted that when using `x.py doc std`, it only generated `std` (and the crates "before" it). r? `@Mark-Simulacrum`
2021-05-15Don't generate more docs than necessaryGuillaume Gomez-9/+22
2021-05-11Enable `--show-type-layout` for the rustdoc API docsCamelid-0/+1
2021-05-11Enable `--show-type-layout` for the rustc API docsCamelid-0/+1
2021-04-21Rollup merge of #84393 - GuillaumeGomez:better-open-handling, r=jyn514Mara Bos-6/+10
Support `x.py doc std --open` I usually run this command: ``` ./x.py doc std --stage 1 --jobs 8 ``` Then I gave a try to `--open` and realized it wasn't working. I finally realized it was simply because it was only handling paths starting with `library`. This PR allows to handle both kinds of paths. cc ``@jyn514`` r? ``@Mark-Simulacrum``
2021-04-21Correctly handle --open argument on doc commandGuillaume Gomez-6/+10
2021-04-19Remove comment about doc hack.Eric Huss-9/+0
2021-04-06Bump bootstrap compilerEric Huss-1/+1
2021-04-05Document compiler/ with -Aprivate-intra-doc-linksJoshua Nelson-0/+2
Since compiler/ always passes --document-private-items, it's ok to link to items that are private.
2021-04-04Workaround increased cache clearing in CargoMark Rousskov-1/+10
1.52 Cargo adds rust-lang/cargo#8640 which means that cargo will try to purge the doc directory caches for us. In theory this may mean that we can jettison the clear_if_dirty for rustdoc versioning entirely, but for now just workaround the effects of this change in a less principled but more local way.
2021-03-12Add a `disable-minification` option for rustdocMichael Howell-0/+12
This way, you can debug rustdoc's JavaScript and CSS file with normal F12 Dev Tools and you'll have useful line numbers to work with.
2021-02-06output rdj docsNixon Enraght-Moony-0/+1
2021-01-31rustbuild: Don't build compiler twice for error-index-generator.Eric Huss-8/+2
2020-12-30Bump bootstrap compiler to 1.50 betaMark Rousskov-4/+1
2020-12-28Rollup merge of #80362 - jyn514:rustc-macros, r=ehussDylan DPC-6/+9
Document rustc_macros on nightly-rustc Fixes https://github.com/rust-lang/rust/issues/80345. ![image](https://user-images.githubusercontent.com/23638587/103113442-b7ba2d00-4628-11eb-8a4d-c542f2d170e1.png) ![image](https://user-images.githubusercontent.com/23638587/103113448-bc7ee100-4628-11eb-8657-2d72e88de656.png) r? ``@ehuss``
2020-12-24Document rustc_macros on nightly-rustcJoshua Nelson-6/+9
2020-12-22Include rustdoc in the compiler docs index.Eric Huss-0/+2
2020-12-12Fix building compiler docs with stage 0Joshua Nelson-1/+4
2020-12-01Rollup merge of #79525 - jyn514:feature-gate-normalize, r=GuillaumeGomezMara Bos-0/+1
Add -Z normalize-docs and enable it for compiler docs Works around https://github.com/rust-lang/rust/issues/79459 by only enabling normalization for the compiler itself (and anyone who opts-in on nightly). Eventually I want to remove this and enable normalization by default, but that's turned out to be [really hard](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/How.20do.20I.20normalize.20projection.20types.20to.20a.20single.20type.3F/near/218125195). This uses a command line option instead of a feature gate so it's easier to pass it to all crates at once. Theoretically it's better to use a feature gate instead so that it's easier for people to use on docs.rs, but I'm also not terribly concerned with how easy it to use a temporary hack. Addresses https://github.com/rust-lang/rust/issues/77459.
2020-11-29Add -Z normalize-docs and enable it for compiler docsJoshua Nelson-0/+1
2020-11-28lint-docs: Add --validate flag to validate lint docs separately.Eric Huss-0/+5
2020-10-26Support enable/disable sanitizers/profiler per target12101111-2/+6
2020-09-22Auto merge of #76799 - Mark-Simulacrum:fix-cross-compile-dist, r=alexcrichtonbors-1/+3
Fix cross compiling dist/build invocations I am uncertain why the first commit is not affecting CI. I suspect it's because we pass --disable-docs on most of our cross-compilation builders. The second commit doesn't affect CI because CI runs x.py dist, not x.py build. Both commits are standalone; together they should resolve #76733. The first commit doesn't really fix that issue but rather just fixes cross-compiled x.py dist, resolving a bug introduced in #76549.
2020-09-18bootstrap: move the version number to a plaintext filePietro Albini-2/+2
The Rust version number is currently embedded in bootstrap's source code, which makes it hard to update it automatically or access it outside of ./x.py (as you'd have to parse the source code). This commit moves the version number to a standalone plaintext file, which makes accessing or updating it trivial.
2020-09-16Pass --target to lint docsMark Rousskov-1/+3
Otherwise, we may not have a standard library built for the native "host" target of the rustc being run.
2020-09-14Fix generating rustc docs with non-default lib directory.Eric Huss-0/+4
2020-09-13Link rustdoc lint docs to the rustdoc book.Eric Huss-3/+0