| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Due to inlining it is possible to visit the same module multiple times
during `<Cache as DocFolder>::fold_crate`, so we keep track of the
modules we've already visited.
|
|
Use a common method for rendering `extern "<abi>"`.
This now consistently shows `extern "C" fn` rather than just `extern fn`.
|
|
rustdoc: Fix the strip-hidden `ImplStripper`
Instead of stripping impls which reference *stripped* items, we keep impls which reference *retained* items. We do this because when we strip an item we immediately return, and do not recurse into it - leaving the contained items non-stripped from the point of view of the `ImplStripper`.
fixes #33069
r? @alexcrichton
|
|
rustdoc: refine cross-crate impl inlining
This changes the current rule that impls within `doc(hidden)` modules aren't inlined, to only inlining impls where the implemented trait and type are reachable in documentation.
fixes #14586
fixes #31948
.. and also applies the reachability checking to cross-crate links.
fixes #28480
r? @alexcrichton
|
|
rustdoc: Disambiguate anchors
Closes https://github.com/rust-lang/rust/issues/32890
|
|
Avoid linking to itself in implementors section of trait page
Fix #32474.
|
|
Instead of stripping impls which reference *stripped* items, we keep impls
which reference *retained* items. We do this because when we strip an
item we immediately return, and do not recurse into it - leaving the
contained items non-stripped from the point of view of the `ImplStripper`.
|
|
|
|
|
|
This changes the current rule that impls within `doc(hidden)` modules
aren't inlined, to only inlining impls where the implemented
trait and type are reachable in documentation.
|
|
We don't want to render default item docs but previously
`doctraititem` naively delegated to the trait definition in those
cases.
Updated tests to also check that this doesn't strip default item
docs from the trait definition.
|
|
In `test/rustdoc/manual_impl.rs` there are now three structs:
* S1 implements and documents required method `a_method`.
* S2 implements and documents `a_method` as well as provided
method `b_method`.
* S3 implements `a_method` and `b_method`, but only documents
`b_method`.
For a struct, we want the rendered trait impls to include documentation
if and only if it appears on the trait implementation itself
(since users can just go to the trait definition for anything not
covered in the impl docs). This means we expect:
* S1, S2, and S3 to all include top-level trait impl docs.
* S1, S2, and S3 to exclude all trait definition docs.
* S1 to show impl docs for `a_method`.
* S2 to show impl docs for `a_method` and `b_method`.
* S3 to show impl docs for `b_method`.
These tests cover those cases.
|
|
Add test to check this resolves #24838 and #26871.
|
|
This was a regression introduced by #31250 where the compiler deferred returning
the results of compilation a little too late (after the `Stop` check was looked
at). This commit alters the stop point to first try to return an erroneous
`result` and only if it was successful return the sentinel `Err(0)`.
Closes #31576
|
|
|
|
|
|
Instead of hardcoding knowledge about the strip-private pass into the
rendering process we represent (some) stripped items as `ItemEnum::StrippedItem`.
Rustdoc will, for example, generate redirect pages for public items
contained in private modules which have been re-exported to somewhere
externally reachable - this will now not only work for the `strip-private`
pass, but for other passes as well, such as the `strip-hidden` pass.
|
|
|
|
|
|
|
|
rustdoc: Consider `doc(no_inline)` in crate-local inlining
Imports with `doc(no_inline)` will not be inlined, even when `doc(inline)` is present.
fixes #32343
r? @alexcrichton
|
|
|
|
|
|
rustdoc: improve crate-local inlining
fixes #28537
r? @alexcrichton
|
|
|
|
|
|
|
|
|
|
fixes #27104
r? @alexcrichton
|
|
|
|
|
|
For summary descriptions we need the first paragraph (adjacent lines
until a blank line) - but the rendered markdown of a code block did not
leave a blank line in the html and was thus included in the summary line.
|
|
fixes #29584
r? @alexcrichton
|
|
|
|
You can now group tests into directories like `run-pass/borrowck` or `compile-fail/borrowck`. By default, all `.rs` files within any directory are considered tests: to ignore some directory, create a placeholder file called `compiletest-ignore-dir` (I had to do this for several existing directories).
r? @alexcrichton
cc @brson
|
|
This effectively only records associated items from either inherent impls or trait definitions in the search-index.
fixes #31808
r? @alexcrichton
|
|
|
|
`clean_srcpath` tries to make the source-path relative to `src_root`,
but this didn't work since `src_root` itself wasn't absolute.
|
|
|
|
fixes #26606
r? @alexcrichton
|
|
fixes #25787
fixes #30366
r? @alexcrichton
|
|
If the span of a local item points into an external macro
its source-file will be bogus.
|
|
|
|
Search results use the mapping found in `ItemType::to_static_str` for
the identifier, which could not be found on the page in the case of
associated items.
|
|
|
|
Fix #30252.
|
|
Previously passed --cfg was used only when collecting doctests.
|
|
|
|
This expands the code which generates unique IDs for Markdown headers within a single block to each rendered page.
fixes #25001
fixes #29449
|