summary refs log tree commit diff
path: root/src/librustdoc/passes
AgeCommit message (Collapse)AuthorLines
2023-01-14Auto merge of #106696 - kylematsuda:early-binder, r=lcnrbors-1/+1
Switch to `EarlyBinder` for `const_param_default` and `impl_trait_ref` queries Part of the work to close #105779 and implement https://github.com/rust-lang/types-team/issues/78. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This PR adds `EarlyBinder` to the return type of `const_param_default` and `impl_trait_ref`, and removes their `bound_X` variants. r? `@lcnr`
2023-01-14fix various subst_identity vs skip_binderKyle Matsuda-1/+1
2023-01-14change impl_trait_ref query to return EarlyBinder; remove ↵Kyle Matsuda-1/+1
bound_impl_trait_ref query; add EarlyBinder to impl_trait_ref in metadata
2023-01-14change usages of impl_trait_ref to bound_impl_trait_refKyle Matsuda-2/+2
2023-01-14Rollup merge of #106766 - GuillaumeGomez:rm-stripper-dead-code, r=notriddleYuki Okushi-11/+1
Remove dead code in rustdoc stripper No changes when this code is removed. cc `@aDotInTheVoid` r? `@notriddle`
2023-01-13Rollup merge of #106813 - oli-obk:sess_cleanup, r=GuillaumeGomez,petrochenkovMatthias Krüger-11/+11
Remove redundant session field There was already a session available in the resolver, so we access that session.
2023-01-13Remove redundant session fieldOli Scherer-11/+11
2023-01-12Fix not displayed re-export of `doc(hidden)` itemGuillaume Gomez-3/+18
2023-01-12Remove dead code in rustdoc stripperGuillaume Gomez-11/+1
2023-01-11Rollup merge of #106427 - mejrs:translation_errors, r=davidtwconils-1/+3
Improve fluent error messages These have been really frustrating me while migrating diagnostics.
2023-01-08Make translate_message return result and add testsmejrs-1/+3
2023-01-06rustdoc: Strip imports of items which are `#[doc(hidden)]`Nixon Enraght-Moony-0/+1
Closes #106379
2023-01-04rename find_parent_node to opt_parent_idMichael Goulet-1/+1
2023-01-01clean: Always store enum disriminant.Nixon Enraght-Moony-1/+4
2022-12-13Combine projection and opaque into aliasMichael Goulet-2/+1
2022-12-08Prevent to try to retrieve auto and blanket implementations if there were ↵Guillaume Gomez-0/+6
errors before this pass
2022-12-04Auto merge of #104757 - camelid:consolidate-lints, ↵bors-499/+439
r=GuillaumeGomez,jyn514,Manishearth Consolidate rustdoc's lint passes into a single pass This should improve performance and simplify the code. r? `@GuillaumeGomez`
2022-11-27Remove Crate::primitives fieldGuillaume Gomez-2/+4
2022-11-22Consolidate rustdoc's lint passes into a single passNoah Lev-499/+439
This should improve performance and simplify the code.
2022-11-17Auto merge of #104170 - cjgillot:hir-def-id, r=fee1-deadbors-2/+2
Record `LocalDefId` in HIR nodes instead of a side table This is part of an attempt to remove the `HirId -> LocalDefId` table from HIR. This attempt is a prerequisite to creation of `LocalDefId` after HIR lowering (https://github.com/rust-lang/rust/pull/96840), by controlling how `def_id` information is accessed. This first part adds the information to HIR nodes themselves instead of a table. The second part is https://github.com/rust-lang/rust/pull/103902 The third part will be to make `hir::Visitor::visit_fn` take a `LocalDefId` as last parameter. The fourth part will be to completely remove the side table.
2022-11-13rustdoc: Resolve doc links in external traits having local implsVadim Petrochenkov-1/+8
2022-11-13Store a LocalDefId in hir::Variant & hir::Field.Camille GILLOT-2/+2
2022-11-07return `None` when def_kind is `DefKind::Use`Takayuki Maeda-1/+2
2022-11-03Remove rustdoc clean::Visibility typeGuillaume Gomez-4/+4
2022-10-30Make rustdoc Item::visibility computed on-demandGuillaume Gomez-12/+15
2022-10-30Auto merge of #103010 - petrochenkov:effvisdoc, r=GuillaumeGomezbors-14/+27
rustdoc: Simplify modifications of effective visibility table It is now obvious that rustdoc only calls `set_access_level` with foreign def ids and `AccessLevel::Public`. The second commit makes one more step and separates effective visibilities coming from rustc from similar data collected by rustdoc for extern `DefId`s. The original table is no longer modified and now only contains local def ids as populated by rustc. cc https://github.com/rust-lang/rust/pull/102026 `@Bryanskiy`
2022-10-30Rollup merge of #103588 - weihanglo:rustdoc/url-redirect, r=notriddleDylan DPC-1/+1
rustdoc: add missing URL redirect https://github.com/rust-lang/rust/pull/94753 missed some redirect settings, and one of the missing URL shows up in an error message. This PR adds those redirects.
2022-10-29rustdoc: Split effective visibilities from rustc from similar data built by ↵Vadim Petrochenkov-14/+27
rustdoc for external def-ids
2022-10-29Add regression test for missing item from private mod in JSON outputGuillaume Gomez-1/+1
2022-10-29Add missing impl blocks for item reexported from private mod in JSON outputGuillaume Gomez-5/+25
2022-10-29Auto merge of #102233 - petrochenkov:effvis, r=jackh726bors-12/+12
privacy: Rename "accessibility levels" to "effective visibilities" And a couple of other naming and comment tweaks. Related to https://github.com/rust-lang/rust/issues/48054 For `enum Level` I initially used naming `enum EffectiveVisibilityLevel`, but it was too long and inconvenient because it's used pretty often. So I shortened it to just `Level`, if it needs to be used from some context where this name would be ambiguous, then it can be imported with renaming like `use rustc_middle::privacy::Level as EffVisLevel` or something.
2022-10-27fix(rustdoc): add missing URL component for error messagesWeihang Lo-1/+1
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-12/+12
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-24rustdoc: parse self-closing tags and attributes in `invalid_html_tags`Michael Howell-1/+54
Fixes #103460
2022-10-19rustdoc: Eliminate uses of `EarlyDocLinkResolver::all_traits`Vadim Petrochenkov-19/+13
2022-10-16rustdoc: Process extern impls in all loaded cratesVadim Petrochenkov-1/+2
including those loaded through hacks.
2022-10-16rustdoc: Do not expect `doc(primitive)` modules to always existVadim Petrochenkov-5/+5
2022-10-12Rollup merge of #102623 - davidtwco:translation-eager, r=compiler-errorsDylan DPC-3/+4
translation: eager translation Part of #100717. See [Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20lists!/near/295010720) for additional context. - **Store diagnostic arguments in a `HashMap`**: Eager translation will enable subdiagnostics to be translated multiple times with different arguments - this requires the ability to replace the value of one argument with a new value, which is better suited to a `HashMap` than the previous storage, a `Vec`. - **Add `AddToDiagnostic::add_to_diagnostic_with`**: `AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure. - **Add `DiagnosticMessage::Eager`**: Add variant of `DiagnosticMessage` for eagerly translated messages (messages in the target language which don't need translated by the emitter during emission). Also adds `eager_subdiagnostic` function which is intended to be invoked by the diagnostic derive for subdiagnostic fields which are marked as needing eager translation. - **Support `#[subdiagnostic(eager)]`**: Add support for `eager` argument to the `subdiagnostic` attribute which generates a call to `eager_subdiagnostic`. - **Finish migrating `rustc_query_system`**: Using eager translation, migrate the remaining repeated cycle stack diagnostic. - **Split formatting initialization and use in diagnostic derives**: Diagnostic derives have previously had to take special care when ordering the generated code so that fields were not used after a move. This is unlikely for most fields because a field is either annotated with a subdiagnostic attribute and is thus likely a `Span` and copiable, or is a argument, in which case it is only used once by `set_arg` anyway. However, format strings for code in suggestions can result in fields being used after being moved if not ordered carefully. As a result, the derive currently puts `set_arg` calls last (just before emission), such as: let diag = { /* create diagnostic */ }; diag.span_suggestion_with_style( span, fluent::crate::slug, format!("{}", __binding_0), Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.emit(); For eager translation, this doesn't work, as the message being translated eagerly can assume that all arguments are available - so arguments _must_ be set first. Format strings for suggestion code are now separated into two parts - an initialization line that performs the formatting into a variable, and a usage in the subdiagnostic addition. By separating these parts, the initialization can happen before arguments are set, preserving the desired order so that code compiles, while still enabling arguments to be set before subdiagnostics are added. let diag = { /* create diagnostic */ }; let __code_0 = format!("{}", __binding_0); /* + other formatting */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.span_suggestion_with_style( span, fluent::crate::slug, __code_0, Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.emit(); - **Remove field ordering logic in diagnostic derive:** Following the approach taken in earlier commits to separate formatting initialization from use in the subdiagnostic derive, simplify the diagnostic derive by removing the field-ordering logic that previously solved this problem. r? ```@compiler-errors```
2022-10-10Stabilize rustdoc CHECK_INVALID_HTML_TAGS checkGuillaume Gomez-4/+2
2022-10-10errors: use `HashMap` to store diagnostic argsDavid Wood-3/+4
Eager translation will enable subdiagnostics to be translated multiple times with different arguments - this requires the ability to replace the value of one argument with a new value, which is better suited to a `HashMap` than the previous storage, a `Vec`. Signed-off-by: David Wood <david.wood@huawei.com>
2022-10-03Fix rustdoc ICE in invalid_rust_codeblocks lintNilstrieb-2/+5
The diagnostic message extraction code didn't handle translations yet.
2022-10-01rustdoc: adopt to the new lint APIMaybe Waffle-67/+57
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-1/+1
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-12Rollup merge of #101735 - notriddle:notriddle/backslash-escaped-html, ↵Guillaume Gomez-1/+1
r=GuillaumeGomez rustdoc: fix treatment of backslash-escaped HTML Try generating HTML for this markup: \<a href="https://example.com">example</a> It will produce text, not HTML, in both rustdoc's real HTML output and in the commonmark reference implementation: https://spec.commonmark.org/dingus/?text=%5C%3Ca%20href%3D%22https%3A%2F%2Fexample.com%22%3Eexample%3C%2Fa%3E
2022-09-12Rollup merge of #101732 - Nemo157:gate-rustdoc-missing-examples, ↵Guillaume Gomez-1/+1
r=GuillaumeGomez Feature gate the `rustdoc::missing_doc_code_examples` lint Moves the lint from being implicitly active on nightly `rustdoc` to requiring a feature to activate, like other unstable lints. Uses the new tracking issue https://github.com/rust-lang/rust/issues/101730
2022-09-12rustdoc: fix treatment of backslash-escaped HTMLMichael Howell-1/+1
Try generating HTML for this markup: \<a href="https://example.com">example</a> It will produce text, not HTML, in both rustdoc's real HTML output and in the commonmark reference implementation: https://spec.commonmark.org/dingus/?text=%5C%3Ca%20href%3D%22https%3A%2F%2Fexample.com%22%3Eexample%3C%2Fa%3E
2022-09-12Feature gate the rustdoc::missing_doc_code_examples lintWim Looman-1/+1
2022-09-12rustdoc: improve rustdoc HTML suggestions handling of nested genericsMichael Howell-3/+80
Based on some poor suggestions produced when stablizing this lint and running it on `manformed-generics.rs`
2022-09-10Rustdoc-Json: Correcty handle intra-doc-links to items without HTML pageNixon Enraght-Moony-3/+7
Closes #101531
2022-09-09Rustdoc supportMichael Goulet-2/+2