| Age | Commit message (Collapse) | Author | Lines |
|
Most pages include the item type in the title such as "Struct
std::vec::Vec". However it is missing from the pages for foreign
functions, type definitions, macros, statics and constants. This adds them
so for example, instead of a title of "std::u32::MAX" it is "Constant
std::u32::MAX" to match the others.
|
|
|
|
|
|
|
|
The method wasn't using any `self` data from Context, so it seemed
miseading to implement it as a method.
|
|
|
|
|
|
|
|
cc #35020 which does this properly
|
|
pulled out of #35020
|
|
For tuple structs the where clause comes after the definition.
|
|
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.
|
|
Fix typos
|
|
rustdoc: Remove paths from primitive page <title> tags
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.
|
|
This is a spiritual succesor to #34268/8531d581, in which we replaced a
number of matches of None to the unit value with `if let` conditionals
where it was judged that this made for clearer/simpler code (as would be
recommended by Manishearth/rust-clippy's `single_match` lint). The same
rationale applies to matches of None to the empty block.
|
|
|
|
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.
|
|
Rollup of 5 pull requests
- Successful merges: #34105, #34305, #34512, ~~#34531,~~ #34547
|
|
rustdoc: Remove Derived Implementations title
As far as I know whether a trait was derived or not does not change the
public API so there is no need to include this information in the docs.
This title currently just adds an extra divide in the list of trait
implementations which I don't think needs to be there.
|
|
These are caused by `DefaultImpl`s.
|
|
|
|
- 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).
|
|
Fix invalid inlining
r? @steveklabnik
So to put a context. @nox found an issue on the generated doc:

So as you can see, the two variants are on the same where they shouldn't. I found out that the issue is also on structs:

And so such is the result of the PR:


|
|
We need to use the name of the target not the name of the current item
when creating the link.
|
|
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
|
|
|
|
Refactor away the prelude injection fold
Instead, just inject `#[prelude_import] use [core|std]::prelude::v1::*;` at the crate root while injecting `extern crate [core|std];` and process `#[no_implicit_prelude]` attributes in `resolve`.
r? @nrc
|
|
|
|
As far as I know whether a trait was derived or not does not change the
public API so there is no need to include this information in the docs.
This title currently just adds an extra divide in the list of trait
implementations which I don't think needs to be there.
|
|
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: Add doc snippets for trait impls, with a read more link
The read more link only appears if the documentation is more than one line long.

It currently does not appear on non-defaulted methods, since you can document them directly. I could make it so that default documentation gets forwarded if regular docs don't exist.
Fixes #33672
r? @alexcrichton
cc @steveklabnik
|
|
|
|
|
|
|
|
|
|
Fixes #33672
|
|
|
|
|
|
rustdoc: fix emitting duplicate implementors in .js files
The collect() fn checks for double quotes; use them here as well.
Fixes: #30219
|
|
Update CSS for future rustdoc merge
cc #33382
r? @steveklabnik
cc @Manishearth
cc @birkenfeld
|
|
The collect() fn checks for double quotes; use them here as well.
Fixes: #30219
|
|
rustdoc: add "src" links to individual impls
Since these impls can be scattered around quite a bit, it is nice to be able to jump to the location where individual methods and trait impls are defined.
NOTE: this needs an update to the CSS, which I'd like to leave for whoever is the "rustdoc frontend champion". The new [src] links are currently too large and bold. Also, the interaction with the "since version X" annotations is not good.
Fixes: #30416
|
|
Since these impls can be scattered around quite a bit, it is nice
to be able to jump to the location where individual methods and
trait impls are defined.
Fixes: #30416
|
|
|
|
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).
|