| Age | Commit message (Collapse) | Author | Lines |
|
|
|
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.
|
|
r=aDotInTheVoid,notriddle
Strip impl if not re-exported and is doc(hidden)
Part of #112852.
r? `@aDotInTheVoid`
|
|
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`
|
|
Since the directory that contains source files is called `src`,
it makes sense to name the scripts that way, too.
|
|
The CSS uses an inconsistent mix of both. This commit switches
it to always use `src`.
|
|
|
|
context
|
|
|
|
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````
|
|
|
|
|
|
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's
shrink that.
|
|
|
|
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````
|
|
|
|
fmease:rustdoc-render-assoc-ty-body-before-where-clause, r=notriddle
rustdoc: render the body of associated types before the where-clause
Fixes #112903.
|
|
|
|
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`
|
|
|
|
|
|
|
|
This reverts commit 4b1d13d9841c815915433ca2a3088a8e3e97ad96.
|
|
|
|
|
|
Migrate `item_opaque_ty` to Askama
This PR migrates `item_opaque_ty` to Askama
Refers: https://github.com/rust-lang/rust/issues/108868
|
|
Migrate item_opaque_type to Askama
Fix wrap_item parameters
Fix to write
|
|
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`
|
|
|
|
rustdoc: render visibility on associated types
This should only affect inherent associated types (#8995).
|
|
|
|
Migrate `item_primitive` to Askama
This PR migrates `item_primitive` to Askama
Refers https://github.com/rust-lang/rust/issues/108868
|
|
Migrate `item_trait_alias` to Askama
This PR migrates `item_trait_alias` to Askama
Refers https://github.com/rust-lang/rust/issues/108868
|
|
Implemented wrap_item_write
Update wrap_item
|
|
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
|
|
Migrate `item_proc_macro` to Askama
This PR migrates `item_proc_macro` to Askama
Refers https://github.com/rust-lang/rust/issues/108868
|
|
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
|
|
|
|
|
|
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
|
|
Fix formatting
Fix CI
|
|
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`
|
|
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)
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|