| Age | Commit message (Collapse) | Author | Lines |
|
|
|
r=GuillaumeGomez
fix ICE in rustdoc::invalid_html_tags
fixes https://github.com/rust-lang/rust/issues/146890
r? ```@GuillaumeGomez```
|
|
Before:
18M build/x86_64-unknown-linux-gnu/doc/search.index/
57M build/x86_64-unknown-linux-gnu/compiler-doc/search.index/
After:
16M build/x86_64-unknown-linux-gnu/doc/search.index/
49M build/x86_64-unknown-linux-gnu/compiler-doc/search.index/
|
|
monomorphization
Unify zero-length and oversized SIMD errors
|
|
r=fmease,lolbinarycat,GuillaumeGomez
prevent line number from being copied in chrome
- Closes rust-lang/rust#146816
Fix the issue where line numbers are copied along with code in Chrome
|
|
|
|
|
|
|
|
|
|
|
|
fix a crash in rustdoc merge finalize without input file
- Closes rust-lang/rust#146646
`SerializedSearchIndex::union` calls `Symbol::intern`, requiring `SESSION_GLOBALS` to be set.
|
|
Introduce "wrapper" helpers to rustdoc
Add a few traits for streamlining places where we need to wrap certain `fmt::Display`s in stuff like parentheses or brackets.
Hopefully this makes the actual display logic slightly easier to read.
First two commits are small, unrelated cleanups.
I'll probably add some doc comments to the stuff in `display.rs`, maybe also play around with the API, but wanted to get feedback on this idea first.
|
|
|
|
|
|
|
|
Co-authored-by: Anne Stijns <anstijns@gmail.com>
|
|
|
|
rustdoc-search: JavaScript optimization based on Firefox Profiler output
Part of https://github.com/rust-lang/rust/issues/146048
Preview: https://notriddle.com/rustdoc-html-demo-12/stringdex-js-opt/std/index.html
These commits are based on some profiler readings, and should reduce CPU usage for name-based searching.
- The first commit improves warm searches by allocating less garbage when data is already loaded:
Before: https://profiler.firefox.com/public/wvzd88m8r70p8frvz1z628tv3htwna0b9c0ef10/calltree/?globalTrackOrder=0w2&implementation=js&thread=3&v=11
After: https://profiler.firefox.com/public/yfe9aq6ep3kacw3zmr7jqn6gv7ckfq86rg89568/calltree/?globalTrackOrder=0w2&implementation=js&thread=3&v=11
- The second commit improves cold searches by delaying load for special type names until type-based search runs
Before: 5.86s (throttled to "Good 2G" in Dev Tools) <https://doc.rust-lang.org/nightly/std/index.html?search=>
<img width="2524" height="919" alt="image" src="https://github.com/user-attachments/assets/8dbbbd46-b7ab-4e3c-9e8c-f1e41cfaa968" />
After: 5.77s (throttled to "Good 2G" in Dev Tools) <https://notriddle.com/rustdoc-html-demo-12/stringdex-js-opt/std/index.html?search=>
<img width="2524" height="912" alt="image" src="https://github.com/user-attachments/assets/6976a584-24f4-4d47-8118-7a81b22d411e" />
For comparison's sake, the same test takes 12.17s on stable <https://doc.rust-lang.org/1.89.0/std/index.html?search=>
<img width="2525" height="916" alt="image" src="https://github.com/user-attachments/assets/eb6df2e8-6632-4bef-a6d0-5179c6288fd0" />
|
|
Remove ImplSubject
It only has one usage in rustdoc.
|
|
Clean up `ty::Dynamic`
1. As a follow-up to PR rust-lang/rust#143036, remove `DynKind` entirely.
2. Inside HIR ty lowering, consolidate modules `dyn_compatibility` and `lint` into `dyn_trait`
* `dyn_compatibility` wasn't about dyn compatibility itself, it's about lowering trait object types
* `lint` contained dyn-Trait-specific diagnostics+lints only
|
|
|
|
|
|
|
|
These functions used to be shared with the JSON backend but nowadays they
aren't.
|
|
This avoids blocking on these lookups, so name-based searches
return results more quickly.
|
|
|
|
|
|
|
|
This commit is a mirrored change from stringdex that
makes `at()` not always return a promise, which is fine because
we can still `await` it.
|
|
r=lolbinarycat
[rustdoc] Correctly handle literal search on paths
Fixes https://github.com/rust-lang/rust/issues/146129.
cc ```@notriddle```
r? ```@lolbinarycat```
|
|
Improve suggestion in case a bare URL is surrounded by brackets
Fixes https://github.com/rust-lang/rust/issues/146162.
With this change, output looks like this:
```
|
1 | //! [https://github.com]
| ^^^^^^^^^^^^^^^^^^^^ help: use an automatic link instead: `<https://github.com>`
|
= note: bare URLs are not automatically turned into clickable links
= note: `#[warn(rustdoc::bare_urls)]` on by default
```
cc ```@fmease```
r? ```@lolbinarycat```
|
|
|
|
Strip frontmatter in fewer places
* Stop stripping frontmatter in `proc_macro::Literal::from_str` (RUST-146132)
* Stop stripping frontmatter in expr-ctxt (but not item-ctxt!) `include`s (RUST-145945)
* Stop stripping shebang (!) in `proc_macro::Literal::from_str`
* Not a breaking change because it did compare spans already to ensure there wasn't extra whitespace or comments (`Literal::from_str("#!\n0")` already yields `Err(_)` thankfully!)
* Stop stripping frontmatter+shebang inside some rustdoc code where it doesn't make any observable difference (see self review comments)
* (Stop stripping frontmatter+shebang inside internal test code)
Fixes https://github.com/rust-lang/rust/issues/145945.
Fixes https://github.com/rust-lang/rust/issues/146132.
r? fee1-dead
|
|
|
|
|
|
|
|
|
|
rustdoc-search: yet another stringdex optimization attempt
This one's uses a different tactic. It shouldn't significantly increase the amount of downloaded index data, but still reduces the amount of disk usage.
This one works by changing the suffix-only node representation to omit some data that's needed for checking. Since those nodes make up the bulk of the tree, it reduces the data they store, but also requires validating the match by fetching the name itself (but the names list is pretty small, and when I tried it with wordnet "indexing" it was about the same).
r? `@GuillaumeGomez`
|
|
This one's uses a different tactic. It shouldn't significantly
increase the amount of downloaded index data, but still reduces
the amount of disk usage.
This one works by changing the suffix-only node representation
to omit some data that's needed for checking. Since those nodes
make up the bulk of the tree, it reduces the data they store,
but also requires validating the match by fetching the name
itself (but the names list is pretty small, and when I tried
it with wordnet "indexing" it was about the same).
|
|
r=lolbinarycat
[rustdoc] Uncomment code to add scraped rustdoc examples in loaded paths
Since the bug was fixed in https://github.com/rust-lang/rust/pull/146091, we can now uncomment the code. :)
r? lolbinarycat
|
|
fix(rustdoc): match rustc `--emit` precedence
Resolves rust-lang/rust#141664
This changes rustdoc's `--emit` to allow only one instance of each type, regardless of the actual data that `--emit` carries. This matches rustc's `--emit` behavior.
As of the writing, only `dep-info` emit type carries extra data.
|
|
|
|
Change rustdoc's `--emit` to allow only one instance of each type,
regardless of the actual data that `--emit` carries.
This matches rustc's `--emit` behavior.
As of the writing, only `dep-info` emit type carries extra data.
See <https://github.com/rust-lang/rust/issues/141664>
|
|
r=notriddle
Fix search index generation
Fixes this issue:
```
error: couldn't generate documentation: failed to read column from disk: data consumer error: missing field `unknown number` at line 1 column 8
|
= note: failed to create or modify "build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/search.index/entry/": failed to read column from disk: data consumer error: missing field `unknown number` at line 1 column 8
warning: `theme_css` (lib doc) generated 1 warning
error: could not document `theme_css`
```
The problem was that a conversion was forgotten for the `ItemType` enum.
Thanks a lot to `@janis-bhm!`
r? `@lolbinarycat`
|
|
Remove dead code stemming from an old effects desugaring
CC https://github.com/rust-lang/rust/pull/132374, https://github.com/rust-lang/rust/pull/133443.
r? fee1-dead
|
|
r=GuillaumeGomez
fix rustdoc `render_call_locations` panicking because of default span `DUMMY_SP` pointing at non local-source file
fixes https://github.com/rust-lang/rust/issues/144752
related to/builds on https://github.com/rust-lang/rust/pull/145008
bevy still crashes in the same way as rust-lang/rust#144752 when building docs on nightly, and from what I can tell the cause seems to be the following (copied from zulip [#t-rustdoc > docs on nightly with example scrapes crash](https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/docs.20on.20nightly.20with.20example.20scrapes.20crash)):
> render_call_locations tries to [find](https://github.com/rust-lang/rust/blob/84a17470220e7adf249b18d7c0178dfbede89462/src/librustdoc/html/render/mod.rs#L2816) the source span of a call to add as an example, but the example files are never actually in the source map from what I can tell, and so it falls back to the default span, which points at the first file in the source map.
> Now, the issue that guillaume mentions [here](https://github.com/rust-lang/rust/pull/145008) adds new files to the source map in order to get them into the dep info, and that leads to some files, namely docs-rs/trait-tags.html in the case of bevy because it's added with --html-after-content, being added before any source files, so then the default span points at them, and when href_from_span tries to find the [source file](https://github.com/rust-lang/rust/blob/84a17470220e7adf249b18d7c0178dfbede89462/src/librustdoc/html/render/context.rs#L368) corresponding to the span, the file doesn't belong to local_sources, and it short circuits.
> This can be fixed by just not using DUMMY_SP as the default span and calculating, for example, the crates root source file as the span, because I'm not entirely sure what the href from that span is actually used for; it's not what links to the example in the end.
> I think the proper way of fixing this would be to make sure the example files are part of the local_sources or at least the source map, but I don't know nearly enough about rust internals to be able to figure out how to fix that.
I've included a test that's mostly copied from rust-lang/rust#145008's test with the addition of `--html-after-content after.html` in the `RUSTDOCFLAGS`, which panics on master in conjunction with the `-Zrustdoc-scrape-examples` cargo flag.
cc `@GuillaumeGomez`
|
|
rustdoc-search: skip loading unneeded fnData
Fixes rust-lang/rust#146063 (probably)
Based on the test I ran, it seems like most of the CPU time is being spent loading function signature data. This PR should avoid that.
https://notriddle.com/rustdoc-html-demo-12/skip-loading-function-data/doc/std/index.html
|
|
|
|
|
|
This was done in #145740 and #145947. It is causing problems for people
using r-a on anything that uses the rustc-dev rustup package, e.g. Miri,
clippy.
This repository has lots of submodules and subtrees and various
different projects are carved out of pieces of it. It seems like
`[workspace.dependencies]` will just be more trouble than it's worth.
|