| 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
|
|
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.
|
|
[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.
|
|
|
|
Escape "special characters" (e.g., double quotes `"` and line breaks `\n`).
Escape HTML.
Lastly, add regression tests and clean up existing tests.
|
|
|
|
Co-authored-by: Anne Stijns <anstijns@gmail.com>
|
|
|
|
These functions used to be shared with the JSON backend but nowadays they
aren't.
|
|
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 ..
|
|
With a patch applied to count the number of unifications,
and running the query `Option<T>, (T -> U) -> Option<U>`
before: performed unifyFunctionType on 17484 functions
after: performed unifyFunctionType on 3055 functions
|
|
`is_primitive`, `is_keyword` and `is_attribute` methods
|
|
|
|
Add support for macro expansion in rustdoc source code pages
This is what it looks like:


You can test it [here](https://rustdoc.crud.net/imperio/macro-expansion/src/lib/lib.rs.html). In this case, I also enabled the `--generate-link-to-definition` to show that both options work well together.
Note: <del>There is a bug currently in firefox where the line numbers are not displayed correctly if they're inside the "macro expansion" span: https://bugzilla.mozilla.org/show_bug.cgi?id=1949948<del> Found a workaround around this bug.
r? `@notriddle`
|
|
|
|
karolzwolak:rustdoc-consistent-attributes-rendering, r=GuillaumeGomez
rustdoc: make attributes render consistently
While working on rust-lang/rust#132304, I discovered that even standard attributes aren't consistently rendered.
For some constructs/fields, attributes were missing entirely, and the attributes were only sometimes wrapped in a code-attribute divs so they appear greyed out.
In short this PR:
* makes attributes render inside code elements and inside divs with class `code-attribute`
* renders attributes for macros, associated constants, and struct/union fields
Attributes in `Fields` and `Variants` sections are still not rendered (see struct and enum screenshots), because I wasn't sure we want that.
[Compirison of tests/rustdoc/attributes.rs](https://github.com/karolzwolak/rust/blob/90aa25a1c5dbae1e94099b1a2015dfb83783dbe0/tests/rustdoc/attributes.rs)
Before (left) / after (right):
<img width="279" height="97" alt="image" src="https://github.com/user-attachments/assets/baca4b75-f809-4a76-8ac1-e3aa6389aad4" />
<img width="363" height="112" alt="image" src="https://github.com/user-attachments/assets/14970fb0-6fe5-474f-983e-5a95e16175c5" />
<img width="368" height="492" alt="image" src="https://github.com/user-attachments/assets/f9a25583-10e3-49c7-961b-34f3587b552e" />
<img width="415" height="515" alt="image" src="https://github.com/user-attachments/assets/f2fe4aa0-c731-4f2f-a3c2-04e524a858d1" />
<img width="383" height="483" alt="image" src="https://github.com/user-attachments/assets/bccc1b6e-f236-4948-8557-f9b25cad8a07" />
<img width="402" height="528" alt="image" src="https://github.com/user-attachments/assets/2cea9250-37e1-439e-8010-0603905d0f52" />
<img width="372" height="485" alt="image" src="https://github.com/user-attachments/assets/cd49bc0a-90e1-4d08-af0f-084c42af1834" />
<img width="406" height="542" alt="image" src="https://github.com/user-attachments/assets/67fb4ac7-746b-4e20-9c80-97702a71def8" />
<img width="357" height="131" alt="image" src="https://github.com/user-attachments/assets/42769532-1e4d-486d-bdca-6ecc409554b9" />
<img width="366" height="161" alt="image" src="https://github.com/user-attachments/assets/0b4d01d4-dd8e-4467-8cfc-ad58200ba0d7" />
<img width="291" height="65" alt="image" src="https://github.com/user-attachments/assets/43f61335-8eff-491b-a297-1953d17bbfc0" />
<img width="259" height="57" alt="image" src="https://github.com/user-attachments/assets/598618a3-e52f-4a4e-b790-2c8d5f1b4c77" />
r? ``@GuillaumeGomez``
|
|
* make attributes render inside code elements and inside divs with class `code-attribute`
* render attributes for macros, associated constants, and struct/union fields
|
|
|
|
inside expansion spans
|
|
|
|
|
|
|
|
|
|
|
|
This reverts commit 1140e90074b0cbcfdea8535e4b51877e2838227e.
|
|
This reverts commit 5e8ebd5ecd8546591a6707ac9e1a3b8a64c72f76.
|
|
signedness
|
|
|
|
|
|
|
|
|
|
|
|
r=GuillaumeGomez
rustdoc search: prefer stable items in search results
fixes https://github.com/rust-lang/rust/issues/138067
this does add a new field to the search index, but since we're only listing unstable items instead of adding a boolean flag to every item, it should only increase the search index size of sysroot crates, since those are the only ones using the `staged_api` feature, at least as far as the rust project is concerned.
|
|
|
|
|
|
|
|
[rustdoc] Make aliases search support partial matching
Fixes rust-lang/rust#140782.
To make this work, I moved aliases into the `searchIndex` like any other item. It links to the "original" item with a new `original` field. No so great part is that we need to have some fields like `bitIndex` to be set on the alias to make the description load to work but I consider it minor enough to be ok.
This PR voluntarily doesn't handle de-prioritization of aliases as ```@lolbinarycat``` wished to work on this so I'll leave them this part. :wink:
cc ```@lolbinarycat```
|
|
|