about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-02-08Allow default hash types in conversionRune Tynan-0/+2
2021-02-08Vec -> HashSetRune Tynan-7/+10
2021-02-08Make `header` a vec of modifiers, make FunctionPointer consistent with ↵Rune Tynan-11/+22
Function and Method.
2021-02-08Revert "Get rid of custom pretty-printing in rustdoc"LeSeulArtichaut-1/+71
This reverts commit 31375d2074aeed0c6f173aa200f0bd3bf6d36756.
2021-02-08Auto merge of #81313 - LeSeulArtichaut:revert-32558, r=jyn514bors-50/+8
Restore linking to itself in implementors section of trait page Reverts #32558 as proposed in [this Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Trait.20implementation.20self-links/near/223773273) r? `@jyn514` cc `@camelid`
2021-02-07Enable smart punctuationCamelid-1/+2
2021-02-07Auto merge of #81502 - CraftSpider:method-abi, r=jyn514bors-0/+1
Add abi field to `Method` Also bumps version and adds a test (Will conflict with #81500, whichever is merged first) Rationale: It's possible for methods to have an ABI. This should be exposed in the JSON.
2021-02-06Remove accidentally left-behind git markRune Tynan-1/+0
2021-02-06Auto merge of #80883 - GuillaumeGomez:remove-some-function-fields, r=ollie27bors-220/+246
Remove some function fields Same kind as #80845. This PR removes the `all_types` and `ret_types` from the `clean::Function` type. Another change that I had to do was implementing the `From` trait to be able to convert `hir::def::DefKind` into `clean::TypeKind` without requiring `DocContext` (and so I updated the `clean` method so that it's taken into account). The last two commits improve a bit the `get_real_types` function and the `Type::generics` method. r? `@jyn514`
2021-02-06Restore linking to itself in implementors section of trait pageLeSeulArtichaut-50/+8
2021-02-06Rollup merge of #81766 - jyn514:task-lists, r=GuillaumeGomezJonas Schievink-1/+4
Enable 'task list' markdown extension Closes https://github.com/rust-lang/rust/issues/71183.
2021-02-06Enable 'task list' markdown extensionJoshua Nelson-1/+4
- Add documentation about task lists
2021-02-05Add abi field to `Method`Rune Tynan-0/+2
2021-02-06Rollup merge of #81675 - poliorcetics:respect-shortness, r=jyn514Mara Bos-1/+6
Make rustdoc respect `--error-format short` in doctests Note that this will not work with `cargo test`, only with `rustdoc --test`, I'll have to modify `cargo` as well. Fix #81662. `@rustbot` label +T-rustdoc +A-doctests
2021-02-06Rollup merge of #80011 - Stupremee:stabilize-peekable-next-if, r=dtolnayMara Bos-1/+0
Stabilize `peekable_next_if` This PR stabilizes the `peekable_next_if` feature Resolves #72480
2021-02-05Remove unneeded From trait impl for DefKindGuillaume Gomez-7/+1
2021-02-05Remove unused cache argumentGuillaume Gomez-12/+9
2021-02-05Improve codeGuillaume Gomez-3/+3
2021-02-05Improve html::render::cache::get_real_types codeGuillaume Gomez-5/+127
2021-02-05Remove Function all_types and ret_types fieldsGuillaume Gomez-218/+88
2021-02-05Explicitly match all DefKind item in conversion to TypeKindGuillaume Gomez-0/+43
2021-02-05Rollup merge of #81763 - camelid:rustdoc-passes-desc-up, r=GuillaumeGomezMara Bos-7/+7
Cleanup rustdoc pass descriptions a bit Also changed a couple of comments from "intra-doc-links" to "intra-doc links" (my understanding is that "intra-doc links" is the standard way to refer to them).
2021-02-05Rollup merge of #81500 - CraftSpider:union-kind, r=jyn514Mara Bos-5/+4
Remove struct_type from union output Also bumps the format number and adds a test Rationale: It's illegal to have unions of the form `union Union(i32, f32);`, or `union Union;`. The struct_type field was recently removed from the rustdoc Union AST, at which time this field was changed to always just read "union". It makes sense to completely remove it, as it provides no information.
2021-02-05Rollup merge of #81497 - camelid:rustdoc-display_fn-remove-cell, r=jyn514Mara Bos-11/+11
rustdoc: Move `display_fn` struct inside `display_fn` This makes it clear that it's an implementation detail of `display_fn` and shouldn't be used elsewhere, and it enforces in the compiler that no one else can use it. r? ````@GuillaumeGomez````
2021-02-05Rollup merge of #81318 - CraftSpider:json-trait-fix, r=jyn514Mara Bos-11/+9
rustdoc-json: Fix has_body Previously, `has_body` was always true. Now propagate the type of the method to set it correctly. Relies on #81287, that will need to be merged first.
2021-02-04Cleanup rustdoc pass descriptions a bitCamelid-7/+7
Also changed a couple of comments from "intra-doc-links" to "intra-doc links" (my understanding is that "intra-doc links" is the standard way to refer to them).
2021-02-03Rollup merge of #81681 - Smittyvb:rustdoc-shortcuts-styling, r=GuillaumeGomezGuillaume Gomez-2/+2
Better styling of "Switch result tab" shortcut Before: ![](https://user-images.githubusercontent.com/10530973/106663877-544de400-6572-11eb-98a4-77b6b3d9cd42.png) ![image](https://user-images.githubusercontent.com/10530973/106664790-8d3a8880-6573-11eb-811f-29c4ade31848.png) After: ![](https://user-images.githubusercontent.com/10530973/106663945-6b8cd180-6572-11eb-911a-12c69d935ee5.png) ![](https://user-images.githubusercontent.com/10530973/106664403-05547e80-6573-11eb-84bf-fdd0dfc7dac8.png)
2021-02-03Rollup merge of #81679 - GuillaumeGomez:clean-fixme-match-bind, ↵Guillaume Gomez-2/+10
r=poliorcetics,CraftSpider Bind all clean::Type variants and remove FIXME This is simply a little cleanup. cc `@CraftSpider` r? `@poliorcetics`
2021-02-02Better styling of "Switch result tab" shortcutSmitty-2/+2
2021-02-02Bind all clean::Type variants and remove FIXMEGuillaume Gomez-2/+10
2021-02-02Make rustdoc respect `--error-format short`Alexis Bourget-1/+6
The other two (`human` and `json`) are already handled.
2021-02-02Rollup merge of #81630 - GuillaumeGomez:overflow-sidebar-title-text, r=pickfireJonas Schievink-0/+8
Fix overflowing text on mobile when sidebar is displayed Fixes #81597. Before: ![Screenshot from 2021-02-01 17-21-15](https://user-images.githubusercontent.com/3050060/106486857-610b0300-64b2-11eb-96d3-12b939f5b661.png) After: ![Screenshot from 2021-02-01 17-20-59](https://user-images.githubusercontent.com/3050060/106486840-5cdee580-64b2-11eb-9492-4df27bb39e59.png) cc `@pickfire` r? `@Nemo157`
2021-02-02Rollup merge of #81492 - camelid:rustdoc-internal-mod-vis, r=GuillaumeGomezJonas Schievink-1/+3
rustdoc: Note why `rustdoc::html::markdown` is public Almost all of the modules are crate-private, except for `rustdoc::json::types`, which I believe is intended to be for public use; and `rustdoc::html::markdown`, which is used externally by the error-index generator and so has to be public. r? ``@GuillaumeGomez``
2021-02-02Auto merge of #81557 - GuillaumeGomez:primitive-search, r=ollie27bors-14/+27
Fix primitive search in parameters and returned values Part of #60485. Fixes #74780. Replacing #74879. cc `@camelid` `@jyn514` `@CraftSpider` r? `@ollie27`
2021-02-01Fix overflowing text on mobile when sidebar is displayedGuillaume Gomez-0/+8
2021-02-01Put back primitives in searchGuillaume Gomez-14/+27
2021-02-01Rollup merge of #81592 - GuillaumeGomez:rustdoc-ui-fixes, r=Nemo157Jonas Schievink-11/+2
Rustdoc UI fixes The first commit fixes this bug (I couldn't figure out why we were setting the width manually and it works as expected without so...): ![Screenshot from 2021-01-31 12-58-46](https://user-images.githubusercontent.com/3050060/106384371-d56a7700-63ca-11eb-9e04-c06b40c2ab5e.png) The second commit fixes a small bug. On tablets or computer with very little width, the search section goes "over" the search input, making it impossible to click on the search input: ![Screenshot from 2021-01-31 13-22-37](https://user-images.githubusercontent.com/3050060/106384413-021e8e80-63cb-11eb-8321-391a1f8a4c7e.png) The third and last commit fixes two bugs that you can see in this screenshot: ![Screenshot from 2021-01-31 13-41-05](https://user-images.githubusercontent.com/3050060/106384424-0cd92380-63cb-11eb-82de-76218286c3fb.png) The wheel is going over the search input and the search tab is going under the search results text. The bug was fixed by simply switching to "mobile mode" at a bigger width: ![Screenshot from 2021-01-31 13-49-50](https://user-images.githubusercontent.com/3050060/106384466-4447d000-63cb-11eb-9330-a7cd29403905.png) cc ```@pickfire``` r? ```@Nemo157```
2021-01-31rustdoc: Note why `rustdoc::html::markdown` is publicCamelid-1/+3
Almost all of the modules are crate-private, except for `rustdoc::json::types`, which I believe is intended to be for public use; and `rustdoc::html::markdown`, which is used externally by the error-index generator and so has to be public.
2021-01-31Improve resize handlingGuillaume Gomez-1/+1
2021-01-31Prevent search section to go over search inputGuillaume Gomez-1/+1
2021-01-31Remove unneeded explicit width from search resultsGuillaume Gomez-9/+0
2021-01-31Rollup merge of #81563 - pickfire:patch-6, r=GuillaumeGomezJonas Schievink-0/+4
Improve docblock readability on small screen Before ![image](https://user-images.githubusercontent.com/4687791/106363174-f77bdf00-6361-11eb-898f-d480b8460ab3.png) After ![image](https://user-images.githubusercontent.com/4687791/106363259-6bb68280-6362-11eb-85a1-ef9262681dd7.png) Too much space is wasted on the left side. I wanted to make that 0 but it breaks some part with error symbols. 0 ![image](https://user-images.githubusercontent.com/4687791/106363287-90aaf580-6362-11eb-88c1-62a8313988a7.png) After ![image](https://user-images.githubusercontent.com/4687791/106363276-825cd980-6362-11eb-86eb-6f4611b4ab99.png)
2021-01-31Rollup merge of #81558 - pickfire:patch-5, r=GuillaumeGomezJonas Schievink-1/+2
Fix ascii art text wrapping in mobile Fix #81377 Before ![image](https://user-images.githubusercontent.com/4687791/106362405-a1a53800-635d-11eb-87b9-2f40bbd023bf.png) ![image](https://user-images.githubusercontent.com/4687791/106362410-aa960980-635d-11eb-96ee-979251b213a3.png) ![image](https://user-images.githubusercontent.com/4687791/106362562-80911700-635e-11eb-97ee-b19a6ea2fc6d.png) After ![image](https://user-images.githubusercontent.com/4687791/106362428-b4b80800-635d-11eb-8d5b-e4f51f5501ee.png) ![image](https://user-images.githubusercontent.com/4687791/106362433-bbdf1600-635d-11eb-96af-7043c74b3a0a.png) ![image](https://user-images.githubusercontent.com/4687791/106362570-8f77c980-635e-11eb-928d-ef1d26c13136.png) Note the second image is scrolled to the back (right), I added some padding for the text block (not the code block) to make it more comfortable to read since the last character is stuck to the last character.
2021-01-31Remove extra trailing spacesIvan Tham-1/+1
2021-01-31Fix docblock short code missing end whitespacesIvan Tham-0/+3
2021-01-31Improve docblock readability on small screenIvan Tham-0/+4
2021-01-31Fix ascii art text wrapping in mobileIvan Tham-3/+1
Fix #81377
2021-01-30Balance sidebar `Deref` cycle check with main contentJ. Ryan Stinnett-7/+11
The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense that the main content code path checks for cycles _before_ descending, while the sidebar checks _after_. Checking _before_ is correct, so this changes the sidebar path to match the main content path.
2021-01-30Rollup merge of #81512 - GuillaumeGomez:cleanup-fixme-rustdoc, r=bugadaniYuki Okushi-2/+1
Add missing variants in match binding cc `````@bugadani````` `````@CraftSpider````` r? `````@camelid`````
2021-01-30Rollup merge of #81495 - camelid:rustdoc-output_format-optional, ↵Yuki Okushi-13/+21
r=GuillaumeGomez rustdoc: Remove unnecessary optional Previously, the HTML output format was represented by both `Some(OutputFormat::Html)` and `None` so there's no need to have an optional. Instead, `OutputFormat::Html` is explicitly the default and we no longer have a "tri-state enum". r? `````@GuillaumeGomez`````