about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-2/+1
2023-07-03Rollup merge of #113285 - GuillaumeGomez:display-long-inline-cfg, r=notriddleGuillaume Gomez-3/+3
[rustdoc] Fix display of long inline cfg labels Fixes #87957. Fixes #112880. Before: ![Screenshot from 2023-07-03 13-25-47](https://github.com/rust-lang/rust/assets/3050060/401e2c6b-2cfd-4ae3-9d15-b5e1dfec4201) After: ![Screenshot from 2023-07-03 13-24-49](https://github.com/rust-lang/rust/assets/3050060/e42a34a8-bf60-409d-8a0c-1669d09e7e1e) r? `@notriddle`
2023-07-03Fix display of long inline cfg labelsGuillaume Gomez-3/+3
2023-07-02Auto merge of #108537 - ↵bors-73/+174
GuillaumeGomez:rustdoc-search-whitespace-as-separator, r=notriddle rustdoc: Allow whitespace as path separator like double colon Fixes https://github.com/rust-lang/rust/issues/108447. I think it makes sense since it allows more common cases, however it also makes the syntax heavier. Not sure what the rest of the team thinks about it. In any case we'll need to go through FCP. Full explanation for the changes is available [here](https://github.com/rust-lang/rust/pull/108537#issuecomment-1589480564). r? `@notriddle`
2023-07-01Put `LayoutError` behind reference to shrink resultNilstrieb-1/+1
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's shrink that.
2023-06-29document that the panic in collect_intra_doc_links is load-bearingjyn-0/+4
2023-06-29Rollup merge of #113119 - aDotInTheVoid:reduce-viz, r=notriddleTakayuki Maeda-1/+1
rustdoc: Reduce internal function visibility. As suggested [here](https://github.com/rust-lang/rust/pull/112113/files/1862fcb1df05b116443ad3b27028616a180ffadb#r1211200570).
2023-06-29Rollup merge of #113100 - GuillaumeGomez:search-result-long-name, r=notriddleTakayuki Maeda-9/+29
Fix display of long items in search results Fixes https://github.com/rust-lang/rust/issues/113060. You can test the result [here](https://rustdoc.crud.net/imperio/search-result-long-name/lib2/index.html). To make it a bit better, I also reduced a bit the size of the short documentation from half to 2 fifth of the width. r? `@notriddle`
2023-06-28Rollup merge of #113094 - GuillaumeGomez:fix-invalid-div-tag-in-head, ↵Dylan DPC-6/+4
r=notriddle,fmease Fix invalid HTML DIV tag used in HEAD Fixes https://github.com/rust-lang/rust/issues/113067. The issue also nicely explains the whole problem. r? ``@notriddle``
2023-06-28rustdoc: Reduce internal function visibility.Alona Enraght-Moony-1/+1
As suggested in https://github.com/rust-lang/rust/pull/112113/files/1862fcb1df05b116443ad3b27028616a180ffadb#r1211200570.
2023-06-28Fix display of long items in search resultsGuillaume Gomez-9/+29
2023-06-27Replace `id` attribute with `name` for `<meta>` tagGuillaume Gomez-5/+4
2023-06-27Provide more context for `rustc +nightly -Zunstable-options` on stable许杰友 Jieyou Xu (Joe)-54/+54
2023-06-27Fix invalid HTML DIV tag used in HEADGuillaume Gomez-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-25Auto merge of #113038 - matthiaskrgr:rollup-sdcfkxa, r=matthiaskrgrbors-1/+1
Rollup of 5 pull requests Successful merges: - #112976 (Add test for futures with HRTB) - #113013 (rustdoc: get rid of extra line when line-wrapping fn decls with empty arg list) - #113030 (Add a regression test for #109071) - #113031 (Add a regression test for #110933) - #113036 (Accept `ReStatic` for RPITIT) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-25Rollup merge of #113013 - fmease:rustdoc-decl-line-wrapping-slim-arg-list, ↵Matthias Krüger-1/+1
r=camelid rustdoc: get rid of extra line when line-wrapping fn decls with empty arg list Fixes https://github.com/bevyengine/bevy/issues/8898#issuecomment-1605683417: ![Screenshot 2023-06-24 at 23-42-53 any_with_component in bevy_ecs schedule common_conditions - Rust](https://github.com/rust-lang/rust/assets/14913065/4646eba6-b186-4d78-96d9-aad716a4ef5d) It now prints as shown below (which conforms to the style guide): ```rs pub fn any_with_component<T: Component>( ) -> impl FnMut(Query<'_, '_, (), With<T>>) -> bool + Clone ``` The bug was introduced in #109011.
2023-06-26Rollup merge of #113028 - fmease:rustdoc-x-crate-itiap-clean-term, r=notriddleTakayuki Maeda-13/+5
rustdoc: handle assoc const equalities in cross-crate impl-Trait-in-arg-pos Fixes FIXME (the added test previously lead to an ICE). `@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-25Rollup merge of #112937 - camelid:align-typenames, r=notriddle,GuillaumeGomezMatthias Krüger-2/+4
rustdoc: Align search results horizontally for easy scanning The recent PR #110688 added info about an item's kind before its name in search results. However, because the kind and name are inline with no alignment, it's now hard to visually scan downward through the search results, looking at item names. This PR fixes that by horizontally aligning search results such that there are now two columns of information. r? `@GuillaumeGomez`
2023-06-24rustdoc: get rid of extra line when line-wrapping fn decls with empty arg listLeón Orell Valerian Liehr-1/+1
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-23Reduce typename width to 6.25remNoah Lev-1/+1
This makes "existential type" look slightly cramped (though still readable), but it makes all other typenames look better. Existential types are currently very rare, and we can always tweak this later if necessary.
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-23Rollup merge of #112740 - GuillaumeGomez:link-to-search-chapter, r=notriddleMatthias Krüger-2/+12
Add link to rustdoc book search chapter in help popover One thing that was missing in the rustdoc output and its help popover was a link back to the search feature chapter in the rustdoc book. It looks like this: ![image](https://github.com/rust-lang/rust/assets/3050060/425413e5-e734-4d40-b675-8b2dcef874a2) r? `@notriddle`
2023-06-23Make typenames a bit wider to support "existential type"Noah Lev-1/+1
2023-06-23Abbreviate long typenames so they don't get wrapped in resultsNoah Lev-2/+2
2023-06-23Link to the corresponding channel in the help popoverGuillaume Gomez-5/+12
2023-06-23Add link to rustdoc book search chapter in help popoverGuillaume Gomez-0/+3
2023-06-23Rollup merge of #112927 - GuillaumeGomez:where-clause-indent, r=notriddleMatthias Krüger-7/+14
Fix indentation for where clause in rustdoc pages Screenshot of the bug: ![image](https://github.com/rust-lang/rust/assets/3050060/090cfeaa-0edc-46c7-9ea0-e26ac865b2c2) I used this opportunity to clarify the code a bit because some weird things were going on. r? ````@notriddle````
2023-06-22Align search results horizontally for easy scanningNoah Lev-0/+2
The recent PR #110688 added info about an item's kind before its name in search results. However, because the kind and name are inline with no alignment, it's now hard to visually scan downward through the search results, looking at item names. This PR fixes that by horizontally aligning search results such that there are now two columns of information.
2023-06-22Migrate item_bounds to ty::ClauseMichael Goulet-13/+8
2023-06-22Fix indentation for where clause in rustdoc pagesGuillaume Gomez-7/+14
2023-06-22Rollup merge of #112906 - ↵Matthias Krüger-1/+2
fmease:rustdoc-render-assoc-ty-body-before-where-clause, r=notriddle rustdoc: render the body of associated types before the where-clause Fixes #112903.
2023-06-21rustdoc: render the assoc ty body before the where-clauseLeón Orell Valerian Liehr-1/+2
2023-06-21Rollup merge of #112894 - GuillaumeGomez:gui-fields-display, r=notriddleGuillaume Gomez-11/+11
Fix union fields display ![Screenshot from 2023-06-21 16-47-24](https://github.com/rust-lang/rust/assets/3050060/833b0fe6-7fb6-4371-86c3-d82fa0c3fe49) So two bugs in this screenshot: no whitespace between field name and type name, both fields are on the same line. Both problems come from issues in the templates because all whitespace are removed if a askama "command" follows. r? `@notriddle`
2023-06-21Fix union fields displayGuillaume Gomez-11/+11
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-18/+57
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-20Fix invalid creation of files in rustdocGuillaume Gomez-9/+44
2023-06-20Rollup merge of #112720 - ↵Guillaume Gomez-1/+7
poliorcetics:rustdoc-item-type-color-same-as-item-color, r=notriddle,GuillaumeGomez Rustdoc: search: color item type and reduce size to avoid clashing - rustdoc: search: color item type same as item - rustdoc: search: reduce item type size to 0.875rem to avoid clashing with path and item
2023-06-20Add `Item::def_id` helperGuillaume Gomez-9/+13
2023-06-19rustdoc: js: change color and reduce size of typename in search resultAlexis (Poliorcetics) Bourget-1/+7
2023-06-19Clean up "doc(hidden)" checkGuillaume Gomez-10/+17