about summary refs log tree commit diff
path: root/src/librustdoc/passes/mod.rs
AgeCommit message (Collapse)AuthorLines
2023-09-15Implement custom classes for rustdoc code blocks with ↵Guillaume Gomez-0/+5
`custom_code_classes_in_docs` feature
2023-09-08Reuse rustdoc's doc comment handling in ClippyAlex Macleod-91/+0
2023-02-10Resolve documentation links in rustc and store the results in metadataVadim Petrochenkov-1/+2
This commit implements MCP https://github.com/rust-lang/compiler-team/issues/584 It also removes code that is no longer used, and that includes code cloning resolver, so issue #83761 is fixed.
2022-11-22Consolidate rustdoc's lint passes into a single passNoah Lev-14/+4
This should improve performance and simplify the code.
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-29/+29
2022-04-21rustdoc: Unindent doc fragments on `Attributes` constructionVadim Petrochenkov-5/+0
2022-03-01Fix panic when intra-doc link comes from a generated doc commentGuillaume Gomez-1/+1
2021-12-15rustdoc: remove `--passes` and `--no-defaults`Peter Jaszkowiak-20/+2
- flags no longer function, see #44136 - adjust tests to match new behavior - removed test issue-42875 (covered regression with --no-defaults) - moved input-format to removed flags - move all removed flags to bottom - note flag removal in command help - remove DefaultPassOption enum (now redundant with `show_coverage`)
2021-10-02rustdoc: Improve doctest pass's name and module's nameNoah Lev-4/+4
As the docs at the top of the file say, it is an overloaded pass and actually runs two lints.
2021-08-22Revert "Revert "Don't load all extern crates unconditionally""Joshua Nelson-1/+1
This reverts commit 5f0c54db4e595a6a77048f2b0605138ffa49a326.
2021-07-01Revert "Don't load all extern crates unconditionally"Guillaume Gomez-1/+1
2021-04-09Auto merge of #84030 - jyn514:no-blanket-impls, r=GuillaumeGomezbors-1/+0
rustdoc: Don't generate blanket impls when running --show-coverage `get_blanket_impls` is the slowest part of rustdoc, and the coverage pass completely ignores blanket impls. This stops running it at all, and also removes some unnecessary checks in `calculate_doc_coverage` that ignored the impl anyway. We don't currently measure --show-coverage in perf.rlo, but I tested this locally on cargo and it brought the time down from 2.9 to 1.6 seconds. This also adds back a commented-out test; Rustdoc has been able to deal with `impl trait` for almost a year now. r? `@GuillaumeGomez`
2021-04-09rustdoc: Don't generate blanket impls when running --show-coverageJoshua Nelson-1/+0
get_blanket_impls is the slowest part of rustdoc, and the coverage pass completely ignores blanket impls. This stops running it at all, and also removes some unnecessary checks in `calculate_doc_coverage` that ignored the impl anyway. We don't currently measure --show-coverage in perf.rlo, but I tested this locally on cargo and it brought the time down from 2.9 to 1.6 seconds.
2021-04-05Rename non_autolinks -> bare_urlsJoshua Nelson-4/+4
2021-04-02Don't load all extern crates unconditionallyJoshua Nelson-1/+1
Instead, only load the crates that are linked to with intra-doc links. This doesn't help very much with any of rustdoc's fundamental issues with freezing the resolver, but it at least fixes a stable-to-stable regression, and makes the crate loading model somewhat more consistent with rustc's.
2021-03-04Don't require a `DocContext` for `report_diagnostic`Joshua Nelson-2/+3
This is needed for the next commit, which needs access to the `cx` from within the `decorate` closure. - Change `as_local_hir_id` to an associated function, since it only needs a `TyCtxt` - Change `source_span_for_markdown_range` to only take a `TyCtxt`
2021-02-16Take `&mut DocContext` in passesJoshua Nelson-1/+1
This should hopefully allow for less interior mutability.
2021-01-02Remove unused collapse passGuillaume Gomez-5/+0
2020-11-15Make all rustdoc functions and structs crate-privateJoshua Nelson-30/+30
This gives warnings about dead code.
2020-11-05Rename lint to non_autolinksGuillaume Gomez-4/+4
2020-11-05Rename automatic_links to url_improvementsGuillaume Gomez-4/+4
2020-11-05Add new lint for automatic_links improvementsGuillaume Gomez-0/+5
2020-10-13Clean up rustdoc passesGuillaume Gomez-170/+4
2020-10-07Auto merge of #77119 - GuillaumeGomez:unclosed-html-tag-lint, r=jyn514bors-0/+5
Unclosed html tag lint Part of #67799. I think `@ollie27` will be interested (`@Manishearth` too since they opened the issue ;) ). r? `@jyn514`
2020-10-03Change DocFragments from enum variant fields to structs with a nested enumJoshua Nelson-7/+5
This makes the code a lot easier to work with. It also makes it easier to add new fields without updating each variant and `match` individually. - Name the `Kind` variant after `DocFragmentKind` from `collapse_docs` - Remove unneeded impls
2020-10-03Fix visitor for invalid_html_tag lintGuillaume Gomez-1/+1
2020-10-03Add `unclosed_html_tags` lintGuillaume Gomez-0/+5
2020-08-31Fix strings indentGuillaume Gomez-2/+1
2020-07-27private_items_doc_tests -> doc_test_lintsJoshua Nelson-2/+2
2020-07-27Move `look_for_tests` to `private_items_doc_tests`Joshua Nelson-55/+0
2020-07-27Separate `missing_doc_code_examples` from intra-doc linksJoshua Nelson-12/+19
These two lints have no relation other than both being nightly-only. This allows stabilizing intra-doc links without stabilizing missing_doc_code_examples.
2020-04-23Create new rustdoc lint to check for code blocks tagsGuillaume Gomez-1/+1
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-1/+1
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-1/+1
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-1/+1
2020-02-24don't explicitly compare against true or falseMatthias Krüger-2/+2
2020-02-11Run RustFmtjumbatm-6/+3
2020-02-11Invert control in struct_lint_level.jumbatm-6/+4
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-01-09Rollup merge of #67875 - dtolnay:hidden, r=GuillaumeGomezYuki Okushi-36/+51
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-05Remove rustc_hir reexports in rustc::hir.Mazdak Farrokhzad-1/+1
2020-01-04Distinguish between private items and hidden items in rustdocDavid Tolnay-36/+51
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-04DefId{Map,Set} -> rustc::hir::def_idMazdak Farrokhzad-2/+1
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-1/+1
2019-12-22Format the worldMark Rousskov-34/+21
2019-11-24Fix some rustdoc error capitalizationEsteban Küber-3/+3
2019-09-13Unwrap Visibility fieldsMark Rousskov-3/+3
There's not really any reason to not have the visibility default to inherited, and this saves us the trouble of checking everywhere for whether we have a visibility or not.
2019-09-13Move to print functions on types instead of impl fmt::DisplayMark Rousskov-2/+2
This will eventually allow us to easily pass in more parameters to the functions without TLS or other such hacks
2019-09-10Auto merge of #60387 - Goirad:test-expansion, r=ollie27bors-1/+1
Allow cross-compiling doctests This PR allows doctest to receive a --runtool argument, as well as possibly many --runtool-arg arguments, which are then used to run cross compiled doctests. Also, functionality has been added to rustdoc to allow it to skip testing doctests on a per-target basis, in the same way that compiletest does it. For example, tagging the doctest with "ignore-sgx" disables testing on any targets that contain "sgx". A plain "ignore" still skips testing on all targets. See [here](https://github.com/rust-lang/cargo/pull/6892) for the companion PR in the cargo project that extends functionality in Cargo so that it passes the appropriate parameters to rustdoc when cross compiling and testing doctests. Part of [#6460](https://github.com/rust-lang/cargo/issues/6460)
2019-09-03added feature gate enable-per-target-ignoresDario Gonzalez-1/+1
updated and augmented tests in html/markdown.rs
2019-08-26Account for doc comments coming from proc macros without spansEsteban Küber-10/+11