| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
rustdoc: remove artificial indentation of doctest code
The indentation makes the examples look nicer when printed (when is this done?), but breaks tests using multi-line string literals.
Fixes: #25944
|
|
This makes the examples look nicer when printed (when is this
done?), but breaks tests using multi-line string literals.
Fixes: #25944
|
|
In `impl<T> Trait for T`, the blanket type parameters `T` were
recognized as "local" and "not exported", so these impls were
thrown out.
Now we check if they are generic, and keep them in that case.
Fixes: #29503
|
|
For legacy reasons (presumably), Windows does not permit files name aux.
|
|
|
|
Instead of finding aux-build files in `auxiliary`, we now search for an
`aux` directory relative to the test. So if your test is
`compile-fail/foo.rs`, we would look in `compile-fail/aux`. Similarly,
we ignore the `aux` directory when searching for tets.
|
|
rustdoc: HTML-escape Rust code (from constants)
Especially in cases like the one in the test file, this can blow up the rendering big time if string constants in the code contain HTML.
But also other constants can contain special chars (e.g. `&` as an operator in constant expressions).
|
|
Especially in cases like the one in the test file, this can blow
up the docs big time if string constants in the code contain HTML.
But also other constants can contain special chars (e.g. `&` as an
operator in constant expressions).
|
|
This will go wrong when the constants partially result from macro expansion.
Instead, use the expressions and pretty-print them as Rust code.
Fixes: #33302
|
|
rustdoc: Cleanup ABI rendering
Use a common method for rendering `extern "<abi>"`.
This now consistently shows `extern fn` rather than `extern "C" fn`.
|
|
Make some fatal lexer errors recoverable
I've kept the changes to a minimum since I'm not really sure if this approach is a acceptable.
fixes #12834
cc @nrc
|
|
|
|
|
|
rustdoc: Linkify extern crates
fixes #33178
r? @alexcrichton
|
|
show unstable status for deprecated items
Fixes #32374.
|
|
rustdoc: inline all the impls
This used to be done to avoid inlining impls referencing private items, but is now unnecessary since we actually check that impls do not reference non-doc-reachable items.
fixes #32881
fixes #33025
fixes #33113
r? @alexcrichton
|
|
|
|
An item is inlined and recorded as inlined even if it is
`doc(hidden)`, leading to unchecked external links.
|
|
This used to be done to avoid inlining impls referencing private items,
but is now unnecessary since we actually check that impls do not
reference non-doc-reachable items.
|
|
|
|
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
|
|
|
|
|
|
|
|
|