| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
rustdoc: use ThinVec for generic arg parts
This reduces the size of both these args, and of path segments, so should measurably help with memory use.
|
|
rustdoc: run css and html minifier at build instead of runtime
This way, adding a bunch of comments to the JS files won't make rustdoc slower.
Meant to address https://github.com/rust-lang/rust/pull/136161#issuecomment-2622069453
|
|
librustdoc: create a helper for separating elements of an iterator instead of implementing it multiple times
This implements something similar to [`Itertools::format`](https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.format), but on `Fn`s returning iterators instead of directly on iterators, to allow implementing `Display` without the use of a `Cell` (to handle the possibility of `fmt` being called multiple times while receiving `&self`).
~This is WIP, I just want to get a perf run first to see if the regression I saw in #135494 is fixed~
This was originally part of #135494 , but originally caused a perf regression that was since fixed:
https://github.com/rust-lang/rust/blob/7d5ae1863aa66847a4edf8d2ef9420717df65c5d/src/librustdoc/html/format.rs#L507
|
|
of implementing it multiple times
|
|
|
|
This reduces the size of both these args, and of path segments,
so should measurably help with memory use.
|
|
This way, adding a bunch of comments to the JS files won't make
rustdoc slower.
|
|
|
|
Refactor `fmt::Display` impls in rustdoc
This PR does a couple of things, with the intention of cleaning up and streamlining some of the `fmt::Display` impls in rustdoc:
1. Use the unstable [`fmt::from_fn`](https://github.com/rust-lang/rust/issues/117729) instead of open-coding it.
2. ~~Replace bespoke implementations of `Itertools::format` with the method itself.~~
4. Some more minor cleanups - DRY, remove unnecessary calls to `Symbol::as_str()`, replace some `format!()` calls with lazier options
The changes are mostly cosmetic but some of them might have a slight positive effect on performance.
|
|
|
|
|
|
|
|
|
|
documentation
|
|
|
|
constants and statics are nullary functions, and struct fields are unary functions.
functions (along with methods and trait methods) are prioritized over other
items, like fields and constants.
|
|
r=wesleywiser
Treat safe target_feature functions as unsafe by default [less invasive variant]
This unblocks
* #134090
As I stated in https://github.com/rust-lang/rust/pull/134090#issuecomment-2541332415 I think the previous impl was too easy to get wrong, as by default it treated safe target feature functions as safe and had to add additional checks for when they weren't. Now the logic is inverted. By default they are unsafe and you have to explicitly handle safe target feature functions.
This is the less (imo) invasive variant of #134317, as it doesn't require changing the Safety enum, so it only affects FnDefs and nothing else, as it should.
|
|
re-add --disable-minification to rustdoc
this also makes the rust.docs-minification option work as advertised in config.toml
nothing fancy this time, this is intended to be perma-unstable. it's only really here for the benefit of rustdoc devs.
mitegates https://github.com/rust-lang/rust/issues/135345
It was removed in https://github.com/rust-lang/rust/commit/f9e1f6ffdf03ec33cb29e20c88fc7bcc938c7f42.
|
|
Enable "jump to def" feature on patterns
Part of https://github.com/rust-lang/rust/issues/89095.
Pattern (as in "patterns in pattern matching") were not handled by the feature, it's now added.
It all started when I realized that prelude values like `Some` or `Err` were not getting a link generated either (added support for it in the first commit).
r? ``@fmease``
|
|
|
|
this also makes the rust.docs-minification option work
as advertised in config.toml
nothing fancy this time, this is intended to be perma-unstable.
it's only really here for the benefit of rustdoc devs.
mitegates https://github.com/rust-lang/rust/issues/135345
|
|
rustdoc: Fix mismatched capitalization in sidebar
Previously, the main content used "Aliased Type", while the sidebar said "Aliased type". Now, they both say "Aliased Type", which is the more common capitalization in Rustdoc.
See the following link for an example.
https://doc.rust-lang.org/1.83.0/std/io/type.Result.html
|
|
Previously, the main content used "Aliased Type", while the sidebar said
"Aliased type". Now, they both say "Aliased Type", which is the more common
capitalization in Rustdoc.
See the following link for an example.
https://doc.rust-lang.org/1.83.0/std/io/type.Result.html
|
|
|
|
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
|
|
|
|
|
|
Hide `= _` as associated constant value inside impl blocks
Closes #134320.
### Before:
<img src="https://github.com/user-attachments/assets/19d28811-45d2-4563-9726-f40c6af411c6" width="300"> <img src="https://github.com/user-attachments/assets/1ecf8764-97ce-47f0-87fa-3b174d2fc578" width="300">
### After:
<img src="https://github.com/user-attachments/assets/6408c4ca-b1c4-42e4-884b-248833a4865f" width="300"> <img src="https://github.com/user-attachments/assets/df2f6981-16f6-409f-8abb-73c0a4a71d6b" width="300">
r? `@fmease`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Add some convenience helper methods on `hir::Safety`
Makes a lot of call sites simpler and should make any refactorings needed for https://github.com/rust-lang/rust/pull/134090#issuecomment-2541332415 simpler, as fewer sites have to be touched in case we end up storing some information in the variants of `hir::Safety`
|
|
|
|
rustdoc-search: fix mismatched path when parent re-exported twice
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`FormatRenderer::make_child_renderer` into `save_module_data`
|
|
|
|
|