summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-2/+1
2023-06-27Auto merge of #113083 - matthiaskrgr:rollup-anbqpij, r=matthiaskrgrbors-1/+4
Rollup of 3 pull requests Successful merges: - #113039 (make custom mir ICE a bit nicer) - #113058 (Add/improve code comments) - #113063 (Update books) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-27Rollup merge of #113058 - GuillaumeGomez:improve-code-comments, r=notriddleMatthias Krüger-1/+4
Add/improve code comments Working on something else and did some small comments updates/adds. r? `@notriddle`
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-39/+19
2023-06-26Add/improve code commentsGuillaume Gomez-1/+4
2023-06-26Rollup merge of #112920 - fmease:rustdoc-fix-112904, r=GuillaumeGomezTakayuki Maeda-43/+45
rustdoc: render generic params & where-clauses of cross-crate assoc tys in impls We used to only ever render generic parameters & where-clauses of cross-crate associated types when the item was located inside of a trait and we used to just drop them when it was inside of an impl block (trait or inherent). Fixes #112904. `@rustbot` label A-cross-crate-reexports
2023-06-25rustdoc: handle assoc const equalities in cross-crate impl-Trait-in-arg-posLeón Orell Valerian Liehr-13/+5
2023-06-24rustdoc: render gen params & where-clauses of cross-crate assoc tys in impl ↵León Orell Valerian Liehr-43/+45
blocks
2023-06-23Rollup merge of #112870 - compiler-errors:clause-2, r=oli-obkMatthias Krüger-13/+8
Migrate `item_bounds` to `ty::Clause` Should be simpler than the next PR that's coming up. Last three commits are the relevant ones. r? ``@oli-obk`` or ``@lcnr``
2023-06-23Link to the corresponding channel in the help popoverGuillaume Gomez-0/+3
2023-06-22Migrate item_bounds to ty::ClauseMichael Goulet-13/+8
2023-06-21Rollup merge of #112853 - GuillaumeGomez:type_alias_type, r=oli-obkGuillaume Gomez-4/+17
Add `lazy_type_alias` feature gate Add the `type_alias_type` to be able to have the weak alias used without restrictions. Part of #112792. cc `@compiler-errors` r? `@oli-obk`
2023-06-21Rollup merge of #112836 - GuillaumeGomez:rustdoc-invalid-file-creation, ↵Guillaume Gomez-9/+13
r=notriddle [rustdoc] partially fix invalid files creation Part of #111249. It only removes generation for modules which shouldn't exist. For files, we need the compiler to keep re-export information alive for external items so we can actually have the right path to their location as it's currently not generating them correctly. In case the item is inlined, it shouldn't (and neither should its children) get a file generated. r? ```@notriddle```
2023-06-21Correctly handle Weak type aliases in rustdocGuillaume Gomez-4/+17
2023-06-21Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnrNilstrieb-20/+21
Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind` Does two basic things before I put up a more delicate set of PRs (along the lines of #112714, but hopefully much cleaner) that migrate existing usages of `ty::Predicate` to `ty::Clause` (`predicates_of`/`item_bounds`/`ParamEnv::caller_bounds`). 1. Rename `Clause` to `ClauseKind`, so it's parallel with `PredicateKind`. 2. Add a new `Clause` type which is parallel to `Predicate`. * This type exposes `Clause::kind(self) -> Binder<'tcx, ClauseKind<'tcx>>` which is parallel to `Predicate::kind` 😸 The new `Clause` type essentially acts as a newtype wrapper around `Predicate` that asserts that it is specifically a `PredicateKind::Clause`. Turns out from experimentation[^1] that this is not negative performance-wise, which is wonderful, since this a much simpler design than something that requires encoding the discriminant into the alignment bits of a predicate kind, or something else like that... r? ``@lcnr`` or ``@oli-obk`` [^1]: https://github.com/rust-lang/rust/pull/112714#issuecomment-1595653910
2023-06-20Add `Item::def_id` helperGuillaume Gomez-9/+13
2023-06-19Clean up "doc(hidden)" checkGuillaume Gomez-3/+11
2023-06-19s/Clause/ClauseKindMichael Goulet-20/+21
2023-06-17Move ConstEvaluatable to ClauseMichael Goulet-1/+1
2023-06-17Move WF goal to clauseMichael Goulet-1/+1
2023-06-16Add `AliasKind::Weak` for type aliases.Oli Scherer-0/+5
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
2023-06-14remove drain-on-drop behavior from vec::DrainFilter and add #[must_use]The 8472-3/+3
2023-06-07use wf::object_region_boundsLeón Orell Valerian Liehr-42/+9
2023-06-07rustdoc: re-elide cross-crate default trait object lifetime boundsLeón Orell Valerian Liehr-49/+268
2023-06-05cleanup some skip_binder -> subst_identityKyle Matsuda-3/+3
2023-06-04Rollup merge of #112178 - GuillaumeGomez:fix-inline-private-intermediate, ↵Matthias Krüger-1/+2
r=notriddle Fix bug where private item with intermediate doc hidden re-export was not inlined This fixes this bug: ```rust mod private { /// Original. pub struct Bar3; } /// Hidden. #[doc(hidden)] pub use crate::private::Bar3; /// Visible. pub use self::Bar3 as Reexport; ``` In this case, `private::Bar3` should be inlined and renamed `Reexport` but instead we have: ``` pub use self::Bar3 as Reexport; ``` and no links. There were actually two issues: the first one is that we forgot to check if the next intermediate re-export was doc hidden. The second was that we made the `#[doc(hidden)]` attribute inheritable, which shouldn't be possible. r? `@notriddle`
2023-06-01Fix bug where private item with intermediate doc hidden re-export was not ↵Guillaume Gomez-1/+2
inlined
2023-06-01Rename `impl_defaultness` to `defaultness`Deadbeef-3/+3
2023-05-30rustdoc: simplify `clean` by removing `FnRetTy`Michael Howell-35/+18
The default fn ret ty is always unit. Just use that. Looking back at the time when `FnRetTy` (then called `FunctionRetTy`) was first added to rustdoc, it seems to originally be there because `-> !` was a special form: the never type didn't exist back then. https://github.com/rust-lang/rust/commit/eb01b17b06eb35542bb80ff7456043b0ed5572ba#diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9L921-L924
2023-05-29EarlyBinder::new -> EarlyBinder::bindlcnr-1/+1
2023-05-28Make EarlyBinder's inner value private; and fix all of the resulting errorsKyle Matsuda-6/+6
2023-05-28Replace EarlyBinder(x) with EarlyBinder::new(x)Kyle Matsuda-1/+1
2023-05-27Rollup merge of #112018 - GuillaumeGomez:cleanup-tcx, r=notriddleMatthias Krüger-3/+3
Clean up usage of `cx.tcx` when `tcx` is already set into a variable I discovered a few cases where `cx.tcx` (and equivalents) was used whereas `tcx` was already stored into a variable. In those cases, better to just use `tcx` directly. r? `@notriddle`
2023-05-27Clean up usage of `cx.tcx` when `tcx` is already set into a variableGuillaume Gomez-3/+3
2023-05-27Rollup merge of #111997 - GuillaumeGomez:re-export-doc-hidden-macros, ↵Guillaume Gomez-1/+2
r=notriddle Fix re-export of doc hidden macro not showing up It's part of the follow-up of https://github.com/rust-lang/rust/pull/109697. Re-exports of doc hidden macros should be visible. It was the only kind of re-export of doc hidden item that didn't show up. r? `@notriddle`
2023-05-26Fix re-export of doc hidden macro not showing upGuillaume Gomez-1/+2
2023-05-22rustdoc: Cleanup doc string collapsingVadim Petrochenkov-44/+26
2023-05-13refactor: add chunks method to TokenStream to obviate rustdoc clonesCaleb Cartwright-2/+1
2023-05-10Use proper impl self type for alias impl in rustdocMichael Goulet-8/+9
2023-05-10Rollup merge of #111095 - GuillaumeGomez:fix-assoc-item-trait-inside-hidden, ↵Matthias Krüger-24/+41
r=notriddle Correctly handle associated items of a trait inside a `#[doc(hidden)]` item Fixes https://github.com/rust-lang/rust/issues/111064. cc `@compiler-errors` r? `@notriddle`
2023-05-05Improve code to remove duplicationGuillaume Gomez-28/+24
2023-05-05Modules can be reexported and it should be handled by rustdocGuillaume Gomez-1/+22
2023-05-04IAT: Rustdoc integrationLeón Orell Valerian Liehr-19/+57
2023-05-04IAT: Introduce AliasKind::InherentLeón Orell Valerian Liehr-0/+4
2023-05-04Auto merge of #110806 - WaffleLapkin:unmkI, r=lcnrbors-2/+2
Replace `tcx.mk_trait_ref` with `TraitRef::new` First step in implementing https://github.com/rust-lang/compiler-team/issues/616 r? `@lcnr`
2023-05-02resolve: One more attempt to simplify `module_children`Vadim Petrochenkov-3/+4
2023-04-30Rollup merge of #110631 - notriddle:notriddle/impl-trait-cycle, r=GuillaumeGomezMatthias Krüger-18/+41
rustdoc: catch and don't blow up on impl Trait cycles Fixes #110629 An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay: type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>; type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>; To get it right, track every time rustdoc descends into a type alias, so if it shows up twice, it can be write the path instead of infinitely expanding it.
2023-04-29rustdoc: catch and don't blow up on impl Trait cyclesMichael Howell-18/+41
An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay: type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>; type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>; To get it right, track every time rustdoc descends into a type alias, so if it shows up twice, it can be write the path instead of infinitely expanding it.
2023-04-29Unify attributes retrieval for JSON and HTML renderingGuillaume Gomez-0/+73
2023-04-28Rollup merge of #110904 - fmease:rustdoc-fix-110900, r=compiler-errorsMatthias Krüger-5/+5
rustdoc: rebind bound vars to type-outlives predicates Fixes #110900.