about summary refs log tree commit diff
path: root/src/librustdoc/html/render
AgeCommit message (Collapse)AuthorLines
2023-07-22rustdoc: handle cross-crate RPITITs correctlyLeón Orell Valerian Liehr-2/+2
2023-07-20Rollup merge of #110765 - wackbyte:fix-defaultness-position, ↵Matthias Krüger-4/+4
r=fmease,GuillaumeGomez rustdoc: fix position of `default` in method rendering With the following code: ```rs #![feature(specialization)] pub trait A { unsafe fn a(); } impl A for () { default unsafe fn a() {} } ``` rustdoc would render the `impl` of `a` as ```rs unsafe default fn a() ``` which is inconsistent with the actual position of `default`. This PR fixes this issue.
2023-07-18Auto merge of #113574 - GuillaumeGomez:rustdoc-json-strip-hidden-impl, ↵bors-1/+1
r=aDotInTheVoid,notriddle Strip impl if not re-exported and is doc(hidden) Part of #112852. r? `@aDotInTheVoid`
2023-07-15Auto merge of #113697 - ↵bors-6/+1
GuillaumeGomez:rm-unneeded-externallocation-handling, r=lqd Remove unneeded handling for `ExternalLocation::Unknown` in rustdoc render context Should fix perf regression introduced in https://github.com/rust-lang/rust/pull/113623. r? `@lqd`
2023-07-14rustdoc: use `src` consistently over `source` in JavaScriptMichael Howell-4/+4
Since the directory that contains source files is called `src`, it makes sense to name the scripts that way, too.
2023-07-14rustdoc: use `src` consistently over `source` in codeMichael Howell-2/+2
The CSS uses an inconsistent mix of both. This commit switches it to always use `src`.
2023-07-14Correctly handle `--document-hidden-items`Guillaume Gomez-1/+1
2023-07-14Remove unneeded handling for `ExternalLocation::Unknown` in rustdoc render ↵Guillaume Gomez-6/+1
context
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-1/+1
2023-07-13Rollup merge of #113623 - GuillaumeGomez:add-jump-to-doc, r=notriddleMatthias Krüger-25/+79
Add jump to doc I'm using the source code pages of the compiler quite a lot, but one thing missing is the possibility to jump back from the source code to the item documentation. Since I also got a few others complaining about it, I think it's fine to add it since this option is nightly only. This PR adds a link to jump back to item's documentation on the item definition (so on `Bar` in `struct Bar {... }`, as described in the unofficial [RFC](https://github.com/GuillaumeGomez/rfcs/blob/rustdoc-jump-to-definition/text/000-rustdoc-jump-to-definition.md)). r? ````@notriddle````
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-3/+8
2023-07-12Add jump to docGuillaume Gomez-25/+79
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-23rustdoc: fix position of `default` in method renderingwackbyte-4/+4
2023-06-23Rollup merge of #112927 - GuillaumeGomez:where-clause-indent, r=notriddleMatthias Krüger-2/+2
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-22Fix indentation for where clause in rustdoc pagesGuillaume Gomez-2/+2
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-3/+2
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-3/+2
2023-06-20Fix invalid creation of files in rustdocGuillaume Gomez-7/+34
2023-06-13Fix URL encoding of % sign in Rust Doc.TumoiYorozu-2/+0
2023-06-12Revert "List matching impls on type aliases"Guillaume Gomez-110/+28
This reverts commit 4b1d13d9841c815915433ca2a3088a8e3e97ad96.
2023-06-11Add `item_template` macroNicky Lim-57/+116
2023-06-09List matching impls on type aliasesGuillaume Gomez-28/+110
2023-06-08Rollup merge of #112034 - sladyn98:migrate-opaque-ty, r=GuillaumeGomezGuillaume Gomez-3/+10
Migrate `item_opaque_ty` to Askama This PR migrates `item_opaque_ty` to Askama Refers: https://github.com/rust-lang/rust/issues/108868
2023-06-08Migrate item_opaque_type to Askamasladynnunes-3/+10
Migrate item_opaque_type to Askama Fix wrap_item parameters Fix to write
2023-06-05Rollup merge of #112243 - GuillaumeGomez:rm-unneeded-buffer-creations, ↵Guillaume Gomez-24/+19
r=notriddle Remove unneeded `Buffer` allocations when `&mut fmt::Write` can be used directly With the recent changes, `wrap_item` can now directly take `&mut Write`, which makes some `Buffer` creations unneeded. r? `@notriddle`
2023-06-05Move write! arguments directly into the stringGuillaume Gomez-6/+6
2023-06-05Auto merge of #110945 - wackbyte:doc-vis-on-inherent-assoc-types, r=jshabors-1/+3
rustdoc: render visibility on associated types This should only affect inherent associated types (#8995).
2023-06-03Remove unneeded `Buffer` allocations when `&mut fmt::Write` can be used directlyGuillaume Gomez-23/+18
2023-06-03Auto merge of #112032 - sladyn98:migrate-item-primitive, r=GuillaumeGomezbors-3/+3
Migrate `item_primitive` to Askama This PR migrates `item_primitive` to Askama Refers https://github.com/rust-lang/rust/issues/108868
2023-06-01Rollup merge of #112030 - sladyn98:item-trait-alias, r=GuillaumeGomezMichael Goulet-8/+15
Migrate `item_trait_alias` to Askama This PR migrates `item_trait_alias` to Askama Refers https://github.com/rust-lang/rust/issues/108868
2023-06-01Migrate to Askamasladynnunes-8/+15
Implemented wrap_item_write Update wrap_item
2023-05-31Rollup merge of #112113 - notriddle:notriddle/rm-fnretty, r=GuillaumeGomezMatthias Krüger-21/+12
rustdoc: simplify `clean` by removing `FnRetTy` 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 `DefaultReturn` was later added to rustdoc to mirror a change in HIR, which added a variant for DefaultReturn because it makes `Span` management easier. This isn't needed in rustdoc, since it doesn't carry spans. https://github.com/rust-lang/rust/commit/3f0cc8011aef3f530663302d525bd2d8cb493db5#diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9R1144
2023-05-31Rollup merge of #112031 - sladyn98:migrate-proc-macro, r=GuillaumeGomezMatthias Krüger-10/+16
Migrate `item_proc_macro` to Askama This PR migrates `item_proc_macro` to Askama Refers https://github.com/rust-lang/rust/issues/108868
2023-05-30rustdoc: simplify `clean` by removing `FnRetTy`Michael Howell-21/+12
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-28Migrate to Askamasladynnunes-3/+3
2023-05-28Migrate to Askamasladynnunes-10/+16
2023-05-28Rollup merge of #112005 - sladyn98:item-foreign-types, r=GuillaumeGomezfee1-dead-6/+8
Migrate `item_foreign_type` to Askama This PR continues the migration of `print_item.rs` functions to Askama. This piece of work migrates the function `item_foreign_type` Refers https://github.com/rust-lang/rust/issues/108868
2023-05-27Migrate to Askamasladynnunes-6/+8
Fix formatting Fix CI
2023-05-27Rollup merge of #112018 - GuillaumeGomez:cleanup-tcx, r=notriddleMatthias Krüger-11/+10
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-27Rollup merge of #111946 - nicklimmm:askama-item-template-trait, r=GuillaumeGomezMatthias Krüger-38/+57
rustdoc: Add `ItemTemplate` trait and related functions to avoid repetitively wrapping existing functions Context: https://github.com/rust-lang/rust/pull/111430#discussion_r1200672507 This trait will be used extensively in performing migrations to Askama templates (tracking issue: https://github.com/rust-lang/rust/issues/108868)
2023-05-27Clean up usage of `cx.tcx` when `tcx` is already set into a variableGuillaume Gomez-11/+10
2023-05-27Rollup merge of #111927 - sladyn98:item-static, r=GuillaumeGomezMatthias Krüger-5/+9
Migrate `item_static` to Askama This pull request addresses the type signature of the item_static function in our codebase. Previously, this function accepted a mutable reference to a Buffer for writing output. The current changes modify this to instead accept a mutable reference to any type that implements the Write trait. Referes https://github.com/rust-lang/rust/issues/108868
2023-05-26Formatted file correctlysladynnunes-1/+0
2023-05-26Fixed testssladynnunes-4/+9
2023-05-26Fix failing CIsladynnunes-1/+1
2023-05-25Add `ItemTemplate` traitNicky Lim-38/+57
2023-05-24Migrate item_static to Askamasladynnunes-1/+1