Noah Lev
c90a5b2019
rustdoc-json: Rename typedef to type alias
2023-08-21 14:02:34 -07:00
Noah Lev
062d247cd7
rustdoc: Rename clean items from typedef to type alias
2023-08-21 13:56:22 -07:00
Noah Lev
ea9e442222
rustdoc: Rename "Type Definition" to "Type Alias"
...
This matches the name used by the Rust Reference [1], which is also what
people usually call these items.
[1]: https://doc.rust-lang.org/reference/items/type-aliases.html
2023-08-21 12:53:39 -07:00
Guillaume Gomez
16b34bfae3
Use more named format args
2023-08-16 16:35:23 +02:00
Guillaume Gomez
a1a94b1c0f
Improve code readability by moving fmt args directly into the string
2023-08-16 16:35:23 +02:00
Guillaume Gomez
148a0c1673
Remove some unneeded clone() calls
2023-07-30 13:26:36 +02:00
Guillaume Gomez
b7871e5537
Group write calls when possible and use new format args
2023-07-29 14:40:00 +02:00
León Orell Valerian Liehr
a011dd9dac
Render generic const items in rustdoc
2023-07-28 22:21:42 +02:00
León Orell Valerian Liehr
5924043b86
rustdoc: handle cross-crate RPITITs correctly
2023-07-22 12:20:17 +02:00
Matthias Krüger
80f749dfa0
Rollup merge of #110765 - wackbyte:fix-defaultness-position, 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-20 17:19:32 +02:00
bors
ec362f0ae8
Auto merge of #113574 - GuillaumeGomez:rustdoc-json-strip-hidden-impl, r=aDotInTheVoid,notriddle
...
Strip impl if not re-exported and is doc(hidden)
Part of #112852 .
r? `@aDotInTheVoid`
2023-07-18 02:47:03 +00:00
bors
4c8bb79d9f
Auto merge of #113697 - 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-15 20:31:40 +00:00
Michael Howell
e72fba4160
rustdoc: use src consistently over source in JavaScript
...
Since the directory that contains source files is called `src`,
it makes sense to name the scripts that way, too.
2023-07-14 16:54:14 -07:00
Michael Howell
34bc8fbea3
rustdoc: use src consistently over source in code
...
The CSS uses an inconsistent mix of both. This commit switches
it to always use `src`.
2023-07-14 16:38:01 -07:00
Guillaume Gomez
ab80b36452
Correctly handle --document-hidden-items
2023-07-14 17:25:09 +02:00
Guillaume Gomez
1fa8b9aa56
Remove unneeded handling for ExternalLocation::Unknown in rustdoc render context
2023-07-14 17:04:29 +02:00
Mahdi Dibaiee
e55583c4b8
refactor(rustc_middle): Substs -> GenericArg
2023-07-14 13:27:35 +01:00
Matthias Krüger
361461150b
Rollup merge of #113623 - GuillaumeGomez:add-jump-to-doc, r=notriddle
...
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-13 22:33:24 +02:00
Mark Rousskov
cc907f80b9
Re-format let-else per rustfmt update
2023-07-12 21:49:27 -04:00
Guillaume Gomez
3fd36bc083
Add jump to doc
2023-07-12 16:45:36 +02:00
Nilstrieb
3019c1cb2a
Put LayoutError behind reference to shrink result
...
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's
shrink that.
2023-07-01 21:16:25 +02:00
wackbyte
c67aea7fdd
rustdoc: fix position of default in method rendering
2023-06-23 18:39:31 -04:00
Matthias Krüger
3feee9f1f2
Rollup merge of #112927 - GuillaumeGomez:where-clause-indent, r=notriddle
...
Fix indentation for where clause in rustdoc pages
Screenshot of the bug:

I used this opportunity to clarify the code a bit because some weird things were going on.
r? ````@notriddle````
2023-06-23 13:18:13 +02:00
Guillaume Gomez
9202caaec5
Fix indentation for where clause in rustdoc pages
2023-06-22 17:38:19 +02:00
Matthias Krüger
3ba66df643
Rollup merge of #112906 - 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-22 06:29:33 +02:00
León Orell Valerian Liehr
b866113d19
rustdoc: render the assoc ty body before the where-clause
2023-06-21 21:53:55 +02:00
Guillaume Gomez
f5470af6a6
Rollup merge of #112894 - GuillaumeGomez:gui-fields-display, r=notriddle
...
Fix union fields display

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-21 20:00:51 +02:00
Guillaume Gomez
6f48526963
Fix union fields display
2023-06-21 17:25:19 +02:00
Guillaume Gomez
db95734b9d
Fix invalid creation of files in rustdoc
2023-06-20 18:09:50 +02:00
TumoiYorozu
7b55f08516
Fix URL encoding of % sign in Rust Doc.
2023-06-13 20:14:50 +09:00
Guillaume Gomez
810c5176ad
Revert "List matching impls on type aliases"
...
This reverts commit 4b1d13d984 .
2023-06-12 11:27:56 +02:00
Nicky Lim
e240dab0c8
Add item_template macro
2023-06-11 18:06:34 +08:00
Guillaume Gomez
4b1d13d984
List matching impls on type aliases
2023-06-09 10:36:21 +02:00
Guillaume Gomez
e7059f103b
Rollup merge of #112034 - sladyn98:migrate-opaque-ty, r=GuillaumeGomez
...
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-08 10:15:09 +02:00
sladynnunes
29a51e14d9
Migrate item_opaque_type to Askama
...
Migrate item_opaque_type to Askama
Fix wrap_item parameters
Fix to write
2023-06-08 00:09:15 -07:00
Guillaume Gomez
aabffef06d
Rollup merge of #112243 - GuillaumeGomez:rm-unneeded-buffer-creations, 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-05 17:02:50 +02:00
Guillaume Gomez
48c46f275b
Move write! arguments directly into the string
2023-06-05 15:31:18 +02:00
bors
51f714c8c5
Auto merge of #110945 - wackbyte:doc-vis-on-inherent-assoc-types, r=jsha
...
rustdoc: render visibility on associated types
This should only affect inherent associated types (#8995 ).
2023-06-05 04:54:21 +00:00
Guillaume Gomez
5c77a0d7a7
Remove unneeded Buffer allocations when &mut fmt::Write can be used directly
2023-06-03 17:23:02 +02:00
bors
2f5e6bb817
Auto merge of #112032 - sladyn98:migrate-item-primitive, r=GuillaumeGomez
...
Migrate `item_primitive` to Askama
This PR migrates `item_primitive` to Askama
Refers https://github.com/rust-lang/rust/issues/108868
2023-06-03 14:37:23 +00:00
Michael Goulet
8ceb283c92
Rollup merge of #112030 - sladyn98:item-trait-alias, r=GuillaumeGomez
...
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-01 23:07:37 -07:00
sladynnunes
780719b2dc
Migrate to Askama
...
Implemented wrap_item_write
Update wrap_item
2023-06-01 12:07:58 -07:00
Matthias Krüger
77bbfbcdec
Rollup merge of #112113 - notriddle:notriddle/rm-fnretty, r=GuillaumeGomez
...
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.
eb01b17b06 (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.
3f0cc8011a (diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9R1144)
2023-05-31 07:07:03 +02:00
Matthias Krüger
fdd62cfe7d
Rollup merge of #112031 - sladyn98:migrate-proc-macro, r=GuillaumeGomez
...
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-31 07:07:00 +02:00
Michael Howell
1862fcb1df
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.
eb01b17b06 (diff-384affc1b4190940f114f3fcebbf969e7e18657a71ef9001da6b223a036687d9L921-L924)
2023-05-30 12:22:14 -07:00
sladynnunes
c5e5d6958c
Migrate to Askama
2023-05-28 01:51:55 -07:00
sladynnunes
5c780d9926
Migrate to Askama
2023-05-28 01:37:25 -07:00
fee1-dead
5a191132bb
Rollup merge of #112005 - sladyn98:item-foreign-types, r=GuillaumeGomez
...
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-28 06:29:36 +00:00
sladynnunes
a7329cd66b
Migrate to Askama
...
Fix formatting
Fix CI
2023-05-27 12:19:48 -07:00
Matthias Krüger
9f5dce7d75
Rollup merge of #112018 - GuillaumeGomez:cleanup-tcx, r=notriddle
...
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-27 20:40:29 +02:00