| Age | Commit message (Collapse) | Author | Lines |
|
|
|
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````
|
|
|
|
|
|
[rustdoc] Fix display of long inline cfg labels
Fixes #87957.
Fixes #112880.
Before:

After:

r? `@notriddle`
|
|
|
|
GuillaumeGomez:rustdoc-search-whitespace-as-separator, r=notriddle
rustdoc: Allow whitespace as path separator like double colon
Fixes https://github.com/rust-lang/rust/issues/108447.
I think it makes sense since it allows more common cases, however it also makes the syntax heavier. Not sure what the rest of the team thinks about it. In any case we'll need to go through FCP.
Full explanation for the changes is available [here](https://github.com/rust-lang/rust/pull/108537#issuecomment-1589480564).
r? `@notriddle`
|
|
`LayoutError` is 24 bytes, which is bigger than the `Ok` types, so let's
shrink that.
|
|
rustdoc: Reduce internal function visibility.
As suggested [here](https://github.com/rust-lang/rust/pull/112113/files/1862fcb1df05b116443ad3b27028616a180ffadb#r1211200570).
|
|
Fix display of long items in search results
Fixes https://github.com/rust-lang/rust/issues/113060.
You can test the result [here](https://rustdoc.crud.net/imperio/search-result-long-name/lib2/index.html).
To make it a bit better, I also reduced a bit the size of the short documentation from half to 2 fifth of the width.
r? `@notriddle`
|
|
Co-authored-by: Dániel Buga <bugadani@gmail.com>
|
|
As suggested in
https://github.com/rust-lang/rust/pull/112113/files/1862fcb1df05b116443ad3b27028616a180ffadb#r1211200570.
|
|
|
|
|
|
|
|
|
|
r=camelid
rustdoc: get rid of extra line when line-wrapping fn decls with empty arg list
Fixes https://github.com/bevyengine/bevy/issues/8898#issuecomment-1605683417:

It now prints as shown below (which conforms to the style guide):
```rs
pub fn any_with_component<T: Component>(
) -> impl FnMut(Query<'_, '_, (), With<T>>) -> bool + Clone
```
The bug was introduced in #109011.
|
|
rustdoc: Align search results horizontally for easy scanning
The recent PR #110688 added info about an item's kind before its name in
search results. However, because the kind and name are inline with no
alignment, it's now hard to visually scan downward through the search
results, looking at item names. This PR fixes that by horizontally
aligning search results such that there are now two columns of
information.
r? `@GuillaumeGomez`
|
|
|
|
|
|
This makes "existential type" look slightly cramped (though still
readable), but it makes all other typenames look better. Existential
types are currently very rare, and we can always tweak this later if
necessary.
|
|
Add link to rustdoc book search chapter in help popover
One thing that was missing in the rustdoc output and its help popover was a link back to the search feature chapter in the rustdoc book.
It looks like this:

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````
|
|
The recent PR #110688 added info about an item's kind before its name in
search results. However, because the kind and name are inline with no
alignment, it's now hard to visually scan downward through the search
results, looking at item names. This PR fixes that by horizontally
aligning search results such that there are now two columns of
information.
|
|
|
|
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`
|
|
|
|
r=notriddle
[rustdoc] partially fix invalid files creation
Part of #111249. It only removes generation for modules which shouldn't exist. For files, we need the compiler to keep re-export information alive for external items so we can actually have the right path to their location as it's currently not generating them correctly.
In case the item is inlined, it shouldn't (and neither should its children) get a file generated.
r? ```@notriddle```
|
|
|
|
|
|
[rustdoc] Fix invalid handling of "going back in history" when "go to only search result" setting is enabled
You can test the fix [here](https://rustdoc.crud.net/imperio/back-in-history-fix/lib2/index.html). Enable "Directly go to item in search if there is only one result", then search for `HasALongTraitWithParams` and finally go back to previous page. It should be back on the `index.html` page.
The reason for this bug is that the JS state is cached as is, so when we go back to the page, it resumes where it was left, somewhat (very weird), meaning the search is run again etc. The best way to handle this is to force the JS re-execution in this case so that it doesn't try to resume from where it left and then lead us back to the current page.
r? ``@notriddle``
|
|
search if there is only one result" setting is set to true
|
|
rustdoc: Add search result item types after their name
Here what it looks like:

The idea is to improve accessibility by providing this information directly in the text and not only in the text color. Currently we already use it for doc aliases and for primitive types, so I extended it to all types.
r? `@notriddle`
|
|
|
|
rustdoc-search: clean up type unification and "unboxing"
This PR redesigns parameter matching, return matching, and generics matching to use a single function that compares two lists of types.
It also makes the algorithms more consistent, so the "unboxing" behavior where `Vec<i32>` is considered a match for `i32` works inside generics, and not just at the top level.
|
|
|
|
|
|
|
|
r=notriddle
[rustdoc] Fix URL encoding of % sign
Fix #112580
The % is encoded as %%, but the correct encoding is %25.
|
|
|
|
This feature extends rustdoc to support the syntax that most users will
naturally attempt to use to search for diverging functions.
Part of #60485
It's already possible to do this search with `primitive:never`, but
that's not what the Rust language itself uses, so nobody will try it if
they aren't told or helped along.
|
|
This reverts commit 4b1d13d9841c815915433ca2a3088a8e3e97ad96.
|
|
|
|
This enhances generics with the "unboxing" behavior where A<T>
matches T. It makes this unboxing transitive over generics.
|