| Age | Commit message (Collapse) | Author | Lines |
|
r=GuillaumeGomez,notriddle
If a trait item appears in rustdoc search, hide the corrosponding impl items
fixes rust-lang/rust#138251
cc `@notriddle`
|
|
|
|
for example, if we're showing `Iterator::next`,
we don't need to also show `Range::next` in the results.
Co-authored-by: Michael Howell <michael@notriddle.com>
|
|
highlighter
|
|
|
|
rustdoc-search: stringdex update with more packing
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/
CC rust-lang/rust#146063
|
|
Rollup of 14 pull requests
Successful merges:
- rust-lang/rust#142139 (Include additional hashes in src/stage0)
- rust-lang/rust#146745 (Clarified error note for usize range matching)
- rust-lang/rust#146763 (cg_llvm: Replace some DIBuilder wrappers with LLVM-C API bindings (part 5))
- rust-lang/rust#146788 (chore: removes deprecated discord.)
- rust-lang/rust#146942 ([rustdoc] Finish getting rid of usages `write_str`)
- rust-lang/rust#147061 (fix rebasing cycle heads when not reaching a fixpoint)
- rust-lang/rust#147066 (Fix tracking issue number for feature(macro_attr))
- rust-lang/rust#147081 (doc: fix a typo in platform-support.md)
- rust-lang/rust#147082 (formatting_options: fix alternate docs 0b/0o mixup)
- rust-lang/rust#147086 (compiletest: Use `PanicHookInfo::payload_as_str` now that it's stable in beta)
- rust-lang/rust#147093 (redox: switch to colon as path separator)
- rust-lang/rust#147095 (Library: Remove remaining private `#[repr]` workarounds)
- rust-lang/rust#147098 (Add auto extra-checks in pre-push hook)
- rust-lang/rust#147110 (Fix typo)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=GuillaumeGomez
[rustdoc] Finish getting rid of usages `write_str`
This PR, along with rust-lang/rust#146933 , get rid of all the last usages of the `write_str` fn that was introduced back in rust-lang/rust#136784 .
This *shouldn't* be rolled up along with rust-lang/rust#146933 , since the later of the two to be merged will need to delete the no-longer-used `write_str` fn.
Commits can be reviewed separately.
|
|
rustdoc-search: use the same ID for entry and path to same item
This decreases the size of the compiler-doc from 57MiB to 56MiB.
r? `@GuillaumeGomez`
|
|
|
|
|
|
|
|
rustdoc: put the toolbar on the all item index
|
|
|
|
|
|
This decreases the size of the compiler-doc from 57MiB to 56MiB.
|
|
Rollup of 8 pull requests
Successful merges:
- rust-lang/rust#116882 (rustdoc: hide `#[repr]` if it isn't part of the public ABI)
- rust-lang/rust#135771 ([rustdoc] Add support for associated items in "jump to def" feature)
- rust-lang/rust#141032 (avoid violating `slice::from_raw_parts` safety contract in `Vec::extract_if`)
- rust-lang/rust#142401 (Add proper name mangling for pattern types)
- rust-lang/rust#146293 (feat: non-panicking `Vec::try_remove`)
- rust-lang/rust#146859 (BTreeMap: Don't leak allocators when initializing nodes)
- rust-lang/rust#146924 (Add doc for `NonZero*` const creation)
- rust-lang/rust#146933 (Make `render_example_with_highlighting` return an `impl fmt::Display`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
r=GuillaumeGomez
Make `render_example_with_highlighting` return an `impl fmt::Display`
Removes some more usages of `write_str`. Shouldn't affect runtime, but makes the codebase a bit more consistent.
Each commit can be reviewed separately
|
|
[rustdoc] Add support for associated items in "jump to def" feature
Fixes https://github.com/rust-lang/rust/issues/135485.
r? ``@fmease``
|
|
r=rustdoc
rustdoc: hide `#[repr]` if it isn't part of the public ABI
> [!IMPORTANT]
> Temporarily stacked on top of PR https://github.com/rust-lang/rust/pull/146527; only the last commit is relevant!
Follow-up to rust-lang/rust#115439.
Unblocks rust-lang/rust#116743, CC ``@dtolnay.``
Fixes rust-lang/rust#66401.
Fixes rust-lang/rust#128364.
Fixes rust-lang/rust#137440.
Only display the representation `#[repr(REPR)]` (where `REPR` is not `Rust` or `transparent`) of a given type if none of its variants (incl. the synthetic variants of structs) are `#[doc(hidden)]` and all of its fields are public and not `#[doc(hidden)]` since it's likely not meant to be considered part of the public ABI otherwise.
`--document-{private,hidden}-items` works as expected in this context, too.
Moreover, we now also factor in the presence of `#[doc(hidden)]` when checking whether to show `repr(transparent)` or not.
|
|
Add an attribute to check the number of lanes in a SIMD vector after monomorphization
Allows std::simd to drop the `LaneCount<N>: SupportedLaneCount` trait and maintain good error messages.
Also, extends rust-lang/rust#145967 by including spans in layout errors for all ADTs.
r? ``@RalfJung``
cc ``@workingjubilee`` ``@programmerjake``
|
|
|
|
Escape "special characters" (e.g., double quotes `"` and line breaks `\n`).
Escape HTML.
Lastly, add regression tests and clean up existing tests.
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
|
|
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=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`
|
|
outside of local_sources
add test against crashing with --html-after-content file
correctly add --html-after-content to env not args
formatting fix for rustdoc-call-locations-after-content/rmake.rs
Use local crate source file as default span in `render_call_locations`
- avoids unwrapping the first file added to the source map as a local file in
`href_from_span`
move test to tests/rustdoc-gui, rename to scrape_examples_ice
test link is correct
use rustdocflags, rename path in example, track lock file
factor out duplicate function calls
use compile-flags to make sure the after.html file is actually included in the rustdoc call
fix goml go-to path
increment assert-count in sidebar-source-code.goml
adjust crate-search width in search-result-display.goml
renamed Bar in scrape_examples_ice test
make crate name shorter ..
|
|
|