| 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
|
|
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: put the toolbar on the all item index
|
|
|
|
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.
|
|
|
|
|
|
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 ..
|
|
|
|
* make attributes render inside code elements and inside divs with class `code-attribute`
* render attributes for macros, associated constants, and struct/union fields
|
|
|
|
This reverts commit 1140e90074b0cbcfdea8535e4b51877e2838227e.
|
|
This reverts commit 5e8ebd5ecd8546591a6707ac9e1a3b8a64c72f76.
|
|
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.
|
|
|
|
|
|
|
|
|
|
There are many places that join path segments with `::` to produce a
string. A lot of these use `join("::")`. Many in rustdoc use
`join_with_double_colon`, and a few use `.joined("..")`. One in Clippy
uses `itertools::join`. A couple of them look for `kw::PathRoot` in the
first segment, which can be important.
This commit introduces `rustc_ast::join_path_{syms,ident}` to do the
joining for everyone. `rustc_ast` is as good a location for these as
any, being the earliest-running of the several crates with a `Path`
type. Two functions are needed because `Ident` printing is more complex
than simple `Symbol` printing.
The commit also removes `join_with_double_colon`, and
`estimate_item_path_byte_length` with it.
There are still a handful of places that join strings with "::" that are
unchanged. They are not that important: some of them are in tests, and
some of them first split a path around "::" and then rejoin with "::".
This fixes one test case where `{{root}}` shows up in an error message.
|
|
Implements https://www.github.com/rust-lang/rust/issues/141358.
This has 2 primary benefits:
1. For rustdoc-json consumers, they no longer need to parse strings of
attributes, but it's there in a structured and normalized way.
2. For rustc contributors, the output of HIR pretty printing is no
longer a versioned thing in the output. People can work on
https://github.com/rust-lang/rust/issues/131229 without needing to
bump `FORMAT_VERSION`.
(Over time, as the attribute refractor continues, I expect we'll add new
things to `rustdoc_json_types::Attribute`. But this can be done
separately to the rustc changes).
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- rust-lang/rust#134006 (setup typos check in CI)
- rust-lang/rust#142876 (Port `#[target_feature]` to new attribute parsing infrastructure)
- rust-lang/rust#143038 (avoid suggesting traits from private dependencies)
- rust-lang/rust#143083 (Fix rustdoc not correctly showing attributes on re-exports)
- rust-lang/rust#143283 (document optional jobs)
- rust-lang/rust#143329 (minicore: use core's `diagnostic::on_unimplemented` messages)
Failed merges:
- rust-lang/rust#143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
fixes https://github.com/rust-lang/rust/issues/138067
|
|
rustdoc: cleanups relating to allocations
These commits generally clean up the code a bit and also reduce allocation rates a bit.
r? `@camelid`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove `kw::Empty` uses in rustdoc
Helps with #137978.
r? ``@GuillaumeGomez``
|
|
|
|
|
|
|
|
|
|
Clean up librustdoc::html::render to be better encapsulated
Closes #138567
|