about summary refs log tree commit diff
path: root/src/librustdoc/config.rs
AgeCommit message (Collapse)AuthorLines
2020-04-11Depend on getopts from crates.ioLuca Barbieri-0/+1
rustc_session exports it for other crates to avoid mismatching crate versions.
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-9/+8
2020-03-02Replace ToJson with serdeGuillaume Gomez-5/+11
2020-03-02Put back output-format option for show-coverageGuillaume Gomez-8/+51
2020-02-09Make issue references consistentMatthias Prechtl-1/+4
2020-02-04remove redundant imports (clippy::single_component_path_imports)Matthias Krüger-2/+0
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-2/+1
2020-01-09Rollup merge of #67875 - dtolnay:hidden, r=GuillaumeGomezYuki Okushi-17/+26
Distinguish between private items and hidden items in rustdoc I believe rustdoc should not be conflating private items (visibility lower than `pub`) and hidden items (attribute `doc(hidden)`). This matters now that Cargo is passing --document-private-items by default for bin crates. In bin crates that rely on macros, intentionally hidden implementation details of the macros can overwhelm the actual useful internal API that one would want to document. This PR restores the strip-hidden pass when documenting private items, and introduces a separate unstable --document-hidden-items option to skip the strip-hidden pass. The two options are orthogonal to one another. Fixes #67851. Closes #60884.
2020-01-04Distinguish between private items and hidden items in rustdocDavid Tolnay-17/+26
I believe rustdoc should not be conflating private items (visibility lower than `pub`) and hidden items (attribute `doc(hidden)`). This matters now that Cargo is passing --document-private-items by default for bin crates. In bin crates that rely on macros, intentionally hidden implementation details of the macros can overwhelm the actual useful internal API that one would want to document. This PR restores the strip-hidden pass when documenting private items, and introduces a separate unstable --document-hidden-items option to skip the strip-hidden pass. The two options are orthogonal to one another.
2020-01-04Rollup merge of #67709 - petrochenkov:nodedup2, r=CentrilDylan DPC-6/+1
Introduce an option for disabling deduplication of diagnostics With the intent of using it in UI tests (https://github.com/rust-lang/rust/pull/67122). The option is boolean (`-Z deduplicate-diagnostics=yes/no`) and can be specified multiple times with later values overriding earlier values (`-Z deduplicate-diagnostics=no -Z deduplicate-diagnostics=yes` == `-Z deduplicate-diagnostics=yes`), so it can be set in a hierarchical way, e.g. UI testing infra may disable the deduplication by default with specific tests being able to enable it back.
2020-01-03rustdoc: Respect diagnostic debugging optionsVadim Petrochenkov-6/+1
2020-01-02Normalize `syntax::edition` imports.Mazdak Farrokhzad-1/+1
2019-12-30Support `-Z ui-testing=yes/no`Vadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-67/+62
2019-12-09Add options to --extern flag.Eric Huss-30/+3
2019-11-18improve error messages and documentationGuillaume Gomez-3/+3
2019-11-18Rename rustdoc options --themes and --check-themes to --theme and --check-themeGuillaume Gomez-6/+6
2019-11-18rename check-theme option into check-themesGuillaume Gomez-3/+3
2019-11-18Improve documentation, add checks for themes option arguments, make sure the ↵Guillaume Gomez-1/+7
themes file names are js compatible
2019-11-18Add sentence to tell other options are ignored when running check-themeGuillaume Gomez-3/+3
2019-11-18Apply review commentsGuillaume Gomez-3/+9
2019-11-18Warn instead of failing for themesGuillaume Gomez-2/+1
2019-11-18Stabilize rustdoc theme optionsGuillaume Gomez-1/+3
2019-11-13Auto merge of #66211 - kinnison:kinnison/fix-66159, r=GuillaumeGomezbors-1/+3
Fix ICE when documentation includes intra-doc-link When collecting intra-doc-links we could trigger the loading of extra crates into the crate store due to name resolution finding crates referred to in documentation but not in code. This might be due to configuration differences or simply referring to something else. This would cause an ICE because the newly loaded crate metadata existed in a crate store associated with the rustdoc global context, but the resolver had its own crate store cloned just before the documentation processing began and as such it could try and look up crates in a store which lacked them. In this PR, I add support for `--extern-private` to the `rustdoc` tool so that it is supported for `compiletest` to then pass the crates in; and then I fix the issue by forcing the resolver to look over all the crates before we then lower the input ready for processing into documentation. The first commit (the `--extern-private`) could be replaced with a commit which adds support for `--extern` to `compiletest` if preferred, though I think that adding `--extern-private` to `rustdoc` is more useful anyway since it makes the CLI a little more like `rustc`'s which might help reduce surprise for someone running it by hand or in their own test code. The PR is meant to fix #66159 though it may also fix #65840. cc @GuillaumeGomez
2019-11-08rustdoc: Support --extern-private but treat as --externDaniel Silverstone-1/+3
This makes `rustdoc` support `--extern-private` but treats it the same as `--extern` which is useful for making the CLI more similar to `rustc` to ease test suite integration. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-11-07Stabilize --extern flag without a path.Eric Huss-4/+0
2019-10-21Rollup merge of #65314 - tmiasko:rustdoc-z, r=ollie27Mazdak Farrokhzad-0/+4
rustdoc: forward -Z options to rustc Currently rustdoc does not forward `-Z` options to rustc when building test executables. This makes impossible to use rustdoc to run test samples when crate under test is instrumented with one of sanitizers `-Zsanitizer=...`, since the final linking step will not include sanitizer runtime library. Forward `-Z` options to rustc to solve the issue. Helps with #43031.
2019-10-11rustdoc: forward -Z options to rustcTomasz Miąsko-0/+4
Currently rustdoc does not forward `-Z` options to rustc when building test executables. This makes impossible to use rustdoc to run test samples when crate under test is instrumented with one of sanitizers `-Zsanitizer=...`, since the final linking step will not include sanitizer runtime library. Forward `-Z` options to rustc to solve the issue. Helps with #43031.
2019-10-10Don't pass doctest feature by defaultGuillaume Gomez-4/+1
2019-10-01Prevent rustdoc feature to be passed down to doctestsGuillaume Gomez-1/+0
2019-09-10Add unstable --test-builder to rustdocMark Rousskov-0/+6
This allows overriding the rustc binary used to build tests; it should not generally be necessary as we fallback to the sysroot.
2019-09-03changed target from option to plain target, populated with host triple at ↵Dario Gonzalez-3/+5
argument parsing time if no --target arguments
2019-09-03added feature gate enable-per-target-ignoresDario Gonzalez-0/+7
updated and augmented tests in html/markdown.rs
2019-09-03Added ability to crosscompile doctestsDario Gonzalez-0/+10
2019-09-01remove the unstable rustdoc parameter --linkerAndreas Jonson-5/+0
use the code generation parameter -Clinker (same parameter as rustc) to control what linker to use for building the rustdoc test executables. closes: #63816
2019-08-29Run doctests via out-of-process rustcAndreas Jonson-0/+12
2019-08-24Improve Rustdoc's handling of procedural macrosAaron Hill-0/+14
Fixes #58700 Fixes #58696 Fixes #49553 Fixes #52210 This commit removes the special rustdoc handling for proc macros, as we can now retrieve their span and attributes just like any other item. A new command-line option is added to rustdoc: `--crate-type`. This takes the same options as rustc's `--crate-type` option. However, all values other than `proc-macro` are treated the same. This allows Rustdoc to enable 'proc macro mode' when handling a proc macro crate. In compiletest, a new 'rustdoc-flags' option is added. This allows us to pass in the '--proc-macro-crate' flag in the absence of Cargo. I've opened [an additional PR to Cargo](https://github.com/rust-lang/cargo/pull/7159) to support passing in this flag. These two PRS can be merged in any order - the Cargo changes will not take effect until the 'cargo' submodule is updated in this repository.
2019-08-11Remove thread-local for playground configMark Rousskov-1/+1
2019-08-11Store typed PassesMark Rousskov-8/+8
2019-07-26rustc: Stabilize options for pipelined compilationAlex Crichton-32/+4
This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in #60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in #60419 and #60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes #60419 Closes #60987 Closes #60988
2019-07-23Normalize use of backticks in compiler messages for docSamy Kacimi-2/+2
https://github.com/rust-lang/rust/issues/60532
2019-07-06rustdoc: set cfg(doctest) when collecting doctestsQuietMisdreavus-0/+3
2019-06-08Revert "Set test flag when rustdoc is running with --test option"Oliver Middleton-3/+0
This reverts commit 8ed2292dbe75b9b65e9fe1a079428d1e1e3b610f. It caused doctests in this repository to no longer be tested including all of the core crate.
2019-05-19Auto merge of #60065 - QuietMisdreavus:async-move-doctests, r=ollie27bors-11/+15
rustdoc: set the default edition when pre-parsing a doctest Fixes https://github.com/rust-lang/rust/issues/59313 (possibly more? i think we've had issues with parsing edition-specific syntax in doctests at some point) When handling a doctest, rustdoc needs to parse it beforehand, so that it can see whether it declares a `fn main` or `extern crate my_crate` explicitly. However, while doing this, rustdoc doesn't set the "default edition" used by the parser like the regular compilation runs do. This caused a problem when parsing a doctest with an `async move` block in it, since it was expecting the `move` keyword to start a closure, not a block. This PR changes the `rustdoc::test::make_test` function to set the parser's default edition while looking for a main function and `extern crate` statement. However, to do this, `make_test` needs to know what edition to set. Since this is also used during the HTML rendering process (to make playground URLs), now the HTML renderer needs to know about the default edition. Upshot: rendering standalone markdown files can now accept a "default edition" for their doctests with the `--edition` flag! (I'm pretty sure i waffled around how to set that a long time ago when we first added the `--edition` flag... `>_>`) I'm posting this before i stop for the night so that i can write this description while it's still in my head, but before this merges i want to make sure that (1) the `rustdoc-ui/failed-doctest-output` test still works (i expect it doesn't), and (2) i add a test with the sample from the linked issue.
2019-05-17Use iter() for iterating arrays by sliceJosh Stone-1/+1
These `into_iter()` calls will change from iterating references to values if we ever get `IntoIterator` for arrays, which may break the code using that iterator. Calling `iter()` is future proof.
2019-05-06don't pre-allocate the default edition stringQuietMisdreavus-7/+10
2019-05-06set the default edition when pre-parsing a doctestQuietMisdreavus-10/+11
2019-04-24Set test flag when rustdoc is running with --test optionGuillaume Gomez-0/+3
2019-04-17Rollup merge of #59128 - oli-obk:colorful_json, r=mark-i-m,eddybMazdak Farrokhzad-6/+13
Emit ansi color codes in the `rendered` field of json diagnostics cc @ljedrz Implemented for https://github.com/rust-lang/rust/pull/56595#issuecomment-447645115 (x.py clippy)
2019-04-14Derive Default for ExternEntryAaron Hill-7/+3