| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
For tuple structs the where clause comes after the definition.
|
|
evaluate the array length of fixed size array types in rustdoc
mitgates #34579
to fix it we'd need an expression simplifier.
r? @steveklabnik
cc @Osspial
|
|
|
|
Currently methods from extern crates are sometimes added to the search
index when they shouldn't be or added with the original path rather than
the reexported path. This fixes that by making sure `cache().paths` only
contains local paths like the description for it states. It also fixes a
few minor issues with link rendering and redirect generation which would
point to local crate docs even if the docs for that crate hadn't been
generated.
Also a bug with methods implemented on traits which caused wrong paths and
so dead links in the search results has been fixed.
|
|
Currently primitive pages have a title like "std::u8 - Rust" this changes
it to "u8 - Rust" as "std::u8" is the name of a module not a primitive
type.
|
|
rustdoc: Fix empty Implementations section on some module pages
These are caused by `DefaultImpl`s.
For example [`core::marker`](https://doc.rust-lang.org/nightly/core/marker/#impls).
|
|
rustdoc: Fix a few stripping issues
We need to recurse into stripped modules to strip things like impl methods
but when doing so we must not add any items to the `retained` set.
For example this removes [`core::num::ParseFloatError::__description`](https://doc.rust-lang.org/nightly/core/num/struct.ParseFloatError.html#method.__description) and [`impl Clone for ThreadRng`](https://doc.rust-lang.org/nightly/std/clone/trait.Clone.html).
|
|
These are caused by `DefaultImpl`s.
|
|
We need to recurse into stripped modules to strip things like impl methods
but when doing so we must not add any items to the `retained` set.
|
|
|
|
|
|
- src links/redirects to extern fn from another crate had an extra '/'.
- src links to `pub use` of a crate module had an extra '/'.
- src links to renamed reexports from another crate used the new name
for the link but should use the original name.
|
|
rustdoc: Add stability notices to impl items
Also fixes missing stability notices on methods with no docs.
For example [`f64::is_positive`](https://doc.rust-lang.org/nightly/std/primitive.f64.html#method.is_positive) is missing its deprecation message.
|
|
Also fixes missing stability notices on methods with no docs.
|
|
rustdoc: Fix redirect pages for renamed reexports
We need to use the name of the target not the name of the current item
when creating the link.
An example in `std` is [`std::sys::ext`](https://doc.rust-lang.org/nightly/std/sys/ext/index.html).
|
|
We need to use the name of the target not the name of the current item
when creating the link.
|
|
rustdoc: Don't inline #[doc(hidden)] pub use
Currently if a `#[doc(hidden)] pub use` item is inlined the `hidden`
attribute is ignored so the item can appear in the docs. By never inlining
such imports, they can be stripped.
An example in `std` is [`__OsLocalKeyInner`](https://doc.rust-lang.org/nightly/std/thread/struct.__OsLocalKeyInner.html) which clearly should not be documented.
|
|
rustdoc: Don't generate empty files for stripped items
We need to traverse stripped modules to generate redirect pages, but we shouldn't generate
anything else for them.
This now renders the file contents to a Vec before writing it to a file in one go. I think
that's probably a better strategy anyway.
Fixes: #34025
|
|
Currently if a `#[doc(hidden)] pub use` item is inlined the `hidden`
attribute is ignored so the item can appear in the docs. By never inlining
such imports, they can be stripped.
|
|
These were missing from the cache for some reason meaning the redirect pages failed to render.
|
|
We need to traverse stripped modules to generate redirect pages, but we shouldn't generate
anything else for them.
This now renders the file contents to a Vec before writing it to a file in one go. I think
that's probably a better strategy anyway.
|
|
|
|
|
|
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
|