about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-06-28Auto merge of #85876 - jeanlucthumm:master, r=GuillaumeGomezbors-4/+4
Add `go_to_first` query param to jump to first result Fixes #84214 Note that while the issue initially wanted to navigate to an entry on exact match, the discussion settled on using a query parameter (`&go_to_first=true`) instead, regardless of exact or partial match. Demonstration is attached https://user-images.githubusercontent.com/4934853/120258768-7ff28980-c247-11eb-8c8f-1a2ceb242788.mp4
2021-06-27Auto merge of #86589 - JohnTitor:add-triangle-to-summary, r=jshabors-4/+6
Show triangle on the "Details" disclosure element in all cases Re-submission of #82805, fixes the style issue by applying the same margin as `<p>`. <details><summary>Before</summary> ![before 1](https://user-images.githubusercontent.com/25030997/123215032-e4c99880-d502-11eb-9ccc-6df58f3a6b0b.png) ![before 2](https://user-images.githubusercontent.com/25030997/123215035-e5622f00-d502-11eb-9275-6c6dfcfdf72e.png) </details> <details><summary>After</summary> ![after 1](https://user-images.githubusercontent.com/25030997/123215037-e5fac580-d502-11eb-9b49-c99d1eafb1b4.png) ![after 2](https://user-images.githubusercontent.com/25030997/123215040-e5fac580-d502-11eb-8afc-ab713d3dc658.png) </details> r? `@GuillaumeGomez`
2021-06-27Auto merge of #85359 - lrh2000:reserved-prefixes, r=nikomatsakisbors-1/+1
Reserve prefixed identifiers and literals (RFC 3101) This PR denies any identifiers immediately followed by one of three tokens `"`, `'` or `#`, which is stricter than the requirements of RFC 3101 but may be necessary according to the discussion at [Zulip]. [Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099 The tracking issue #84599 says we'll add a feature gate named `reserved_prefixes`, but I don't think I can do this because it is impossible for the lexer to know whether a feature is enabled or not. I guess determining the behavior by the edition information should be enough. Fixes #84599
2021-06-27Add go_to_first boolean query param to immeidately jump to the first search ↵Jean-Luc Thumm-4/+4
result
2021-06-27Use rustdoc.css for error indexDeadbeef-3/+2
2021-06-27Add FIXME commentYuki Okushi-0/+1
2021-06-26Fix font weight on types, methods and associated types/constsGuillaume Gomez-3/+9
2021-06-26Auto merge of #86449 - Stupremee:render-self-cast-in-type-bound, ↵bors-3/+18
r=GuillaumeGomez rustdoc: Render `<Self as X>::Y` type casts properly across crate bounds My last PR that introduced the type casting did not work for cross-crate re-exported traits, which is fixed in this PR. Fully resolves #85454
2021-06-26Rename 'bad prefix' to 'unknown prefix'.Mara Bos-1/+1
2021-06-26Reserve prefixed identifiers and string literals (RFC 3101)lrh2000-1/+1
This commit denies any identifiers immediately followed by one of three tokens `"`, `'` or `#`, which is stricter than the requirements of RFC 3101 but may be necessary according to the discussion at [Zulip]. [Zulip]: https://rust-lang.zulipchat.com/#narrow/stream/268952-edition-2021/topic/reserved.20prefixes/near/238470099
2021-06-26Auto merge of #84814 - Stupremee:properly-render-hrtbs, r=GuillaumeGomezbors-106/+172
Properly render HRTBs ```rust pub fn test<T>() where for<'a> &'a T: Iterator, {} ``` This will now render properly including the `for<'a>` ![image](https://user-images.githubusercontent.com/39732259/116808426-fe6ce600-ab38-11eb-9452-f33f554fbb8e.png) I do not know if this covers all cases, it only covers everything that I could think of that includes `for` and lifetimes in where bounds. Also someone need to mentor me on how to add a proper rustdoc test for this. Resolves #78482
2021-06-26Auto merge of #86586 - Smittyvb:https-everywhere, r=petrochenkovbors-1/+1
Use HTTPS links where possible While looking at #86583, I wondered how many other (insecure) HTTP links were in `rustc`. This changes most other `http` links to `https`. While most of the links are in comments or documentation, there are a few other HTTP links that are used by CI that are changed to HTTPS. Notes: - I didn't change any to or in licences - Some links don't support HTTPS :( - Some `http` links were dead, in those cases I upgraded them to their new places (all of which used HTTPS)
2021-06-26Rollup merge of #86608 - notriddle:notriddle/cleanup-rustdoc, r=jyn514Yuki Okushi-52/+7
chore(rustdoc): remove unused members of RenderType PR #86561 removes the only place the `generics` member is read. This PR does even more cleanup.
2021-06-26Rollup merge of #86513 - fee1-dead:cross-crate-doc-hidden, r=danielhenrymantillaYuki Okushi-1/+18
Rustdoc: Do not list impl when trait has doc(hidden) Fixes #86448.
2021-06-25Show triangle on the "Details" disclosure element in all casesYuki Okushi-4/+5
Co-authored-by: Miguel Ojeda <ojeda@kernel.org>
2021-06-24chore(rustdoc): remove unused members of RenderTypeMichael Howell-52/+7
Commit e629381653bb3579f0cea0b256e391edef5e8dbb removes the only place these members variables are actually read.
2021-06-24Migrate from custom elements to divs with classes to be compatible with safariStefan Schindler-21/+26
2021-06-24Hide Crate Version on narrow ScreensStefan Schindler-5/+21
2021-06-24Implement Desktop and Mobile version with gridlayoutStefan Schindler-16/+46
* implement sans-serif #85621
2021-06-24Rollup merge of #86561 - notriddle:notriddle/cleanup-rustdoc, r=jyn514Yuki Okushi-22/+0
chore(rustdoc): Remove unused impl block
2021-06-23Use HTTPS links where possibleSmitty-1/+1
2021-06-23Auto merge of #86548 - GuillaumeGomez:fix-crate-filter-search-reset, r=jshabors-0/+4
Fix crate filter search reset I found a fun bug when using rustdoc recently: I made a search, cut the search input content, changed the crate filter, pasted back the input content. To my surprise, the crate filter wasn't applied. It's because that our search input was empty when receiving the `<select>` "onchange" event. To fix this issue, I reset the `currentResults` variable to `null`. It's using the first commit from #86542 so it needs to wait for it before getting merged. r? `@jsha`
2021-06-23Fix search filter updateGuillaume Gomez-0/+4
2021-06-23Auto merge of #86564 - jsha:revert-83826, r=jyn514bors-8/+8
Revert "List trait impls before methods from deref in the sidebar ..." This reverts commit 8a058926ecd6d0988714f8f7a5a31293c533f8c6. Fixes #85618 r? `@jyn514`
2021-06-22Revert "List trait impls before methods from deref in the sidebar of ↵Jacob Hoffman-Andrews-8/+8
Rustdoc's output" This reverts commit 8a058926ecd6d0988714f8f7a5a31293c533f8c6.
2021-06-22chore(rustdoc): Remove unused impl blockMichael Howell-22/+0
2021-06-23Rollup merge of #86523 - LeSeulArtichaut:macros-disambiguators, r=jyn514Dylan DPC-27/+12
Improvements to intra-doc link macro disambiguators A few small improvements around macro disambiguators: - display the link text as it was entered: previously `[macro!()]` would be displayed without the parantheses (fixes #86309) - support `!{}` and `![]` as macro disambiguators (fixes #86310) r? `@jyn514` cc `@Manishearth` `@camelid`
2021-06-22Rollup merge of #86501 - jyn514:doctest-cleanup, r=CraftSpiderYuki Okushi-21/+22
Cleanup handling of `crate_name` for doctests - Remove unnecessary reallocation - Remove unnecessary messing around with `queries` for the crate name; it's simpler and faster to go through the TyCtxt instead - Rename `cratename` -> `crate_name` for consistency with the rest of the compiler
2021-06-22Rollup merge of #86451 - notriddle:notriddle/rustdoc-intra-doc-link-summary, ↵Yuki Okushi-12/+64
r=CraftSpider Resolve intra-doc links in summary desc Before: ![rustdoc-intra-doc-link-summary-before](https://user-images.githubusercontent.com/1593513/122623069-9d995e80-d04f-11eb-8d46-ec2ec126bb5e.png) After: ![rustdoc-intra-doc-link-summary](https://user-images.githubusercontent.com/1593513/122623076-a4c06c80-d04f-11eb-967a-f5916871c34b.png)
2021-06-22Rollup merge of #86402 - tspiteri:source-woff2, r=jshaYuki Okushi-11/+54
rustdoc: add optional woff2 versions of Source Serif and Source Code This provides woff2 versions of Source Serif and Source Code similar to how #82545 provides woff2 versions of Fira Sans. The total byte count for the six files (three for each font family) is reduced by 25% from 476 KiB to 358 KiB.
2021-06-22Accept `!{}` and `![]` as macro disambiguatorsLeSeulArtichaut-3/+5
2021-06-22Account for more casesDeadbeef-4/+4
2021-06-21Don't reallocate the crate name when running doctestsJoshua Nelson-5/+7
2021-06-21Rename cratename -> crate_nameJoshua Nelson-17/+17
This makes it consistent with rustc_session::Options.
2021-06-21Remove unnecessary call to queries.crate_name()Joshua Nelson-3/+2
It's much more complicated than just going through the TyCtxt.
2021-06-22Rollup merge of #86334 - LeSeulArtichaut:86120-links-type-aliases, r=jyn514Yuki Okushi-5/+46
Resolve type aliases to the type they point to in intra-doc links This feels a bit sketchy, but I think it's better than just rejecting the link. Helps with #86120, r? ``@jyn514``
2021-06-22Do not list impl when trait has doc(hidden)Deadbeef-1/+18
2021-06-21Fix handling of disambiguator suffixes for intra-doc linksLeSeulArtichaut-27/+10
2021-06-22Rollup merge of #86473 - fee1-dead:rustdoc-const-unstable, r=jyn514Yuki Okushi-47/+90
Rustdoc: Account for const-unstable functions Fixes #86464
2021-06-22Rollup merge of #86274 - alexander-melentyev:spaces, r=bjorn3Yuki Okushi-2/+2
Spaces
2021-06-21Update comment regarding staged_apiDeadbeef-1/+1
2021-06-21Removed/Updated some cases and simplified `match`Deadbeef-1/+1
2021-06-21Check for const_unstable before printing `const`Deadbeef-40/+61
2021-06-21Auto merge of #86157 - jsha:tera, r=jyn514,GuillaumeGomezbors-176/+225
Use Tera templates for rustdoc. Replaces a format!() call in layout::render with a template expansion. Introduces a `templates` field in SharedContext so parts of rustdoc can share pre-rendered templates. This currently builds in a copy of the single template available, like with static files. However, future work can make this live-loadable with a perma-unstable flag, to make rustdoc developers' work easier. Part of #84419. Demo at https://hoffman-andrews.com/rust/tera/std/string/struct.String.html.
2021-06-21Resolve type aliases to the type they point to in intra-doc linksLeSeulArtichaut-5/+46
2021-06-21Delete spacesAlexander Melentyev-2/+2
2021-06-20Use Tera templates for rustdoc.Jacob Hoffman-Andrews-176/+225
Replaces a format!() call in layout::render with a template expansion. Introduces a `templates` field in SharedContext so parts of rustdoc can share pre-rendered templates. This currently builds in a copy of the single template available, like with static files. However, future work can make this live-loadable with a perma-unstable flag, to make rustdoc developers' work easier.
2021-06-20"(const: unstable)" for stable-but-const-unstableDeadbeef-9/+31
2021-06-19rustdoc: Introduce new `DynTrait` type for better representation of trait ↵Justus K-116/+109
objects
2021-06-19Rollup merge of #86370 - ↵Yuki Okushi-2/+9
matteo-briani:fix-rustdoc-stabilized-versions-layout, r=GuillaumeGomez Fix rustdoc stabilized versions layout Fixes #86342 r? `@GuillaumeGomez`