| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Remove some obsolete code from the compiler
|
|
rustdoc: don't collapse `docblock-short`

|
|
Rollup of 5 pull requests
- Successful merges: #36334, #36335, #36363, #36374, #36467
- Failed merges:
|
|
Set run button transparent instead of invisible
r? @steveklabnik
And of course a screenshot:

|
|
rustdoc: Don't add extra newlines for fully opaque structs
Changes the definition for braced structs with only private or hidden fields to save space on the page.
Before:
```
pub struct Vec<T> {
// some fields omitted
}
```
After:
```
pub struct Vec<T> { /* fields omitted */ }
```
This also cleans up empty braced structs.
Before:
```
pub struct Foo {
}
```
After:
```
pub struct Foo {}
```
[before](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html) [after](https://ollie27.github.io/rust_doc_test/std/vec/struct.Vec.html)
cc #34713
|
|
|
|
rustdoc: Add missing item types to page titles
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.
[before](https://doc.rust-lang.org/nightly/std/u32/constant.MAX.html) [after](https://ollie27.github.io/rust_doc_test/std/u32/constant.MAX.html)
[before](https://doc.rust-lang.org/nightly/std/io/type.Result.html) [after](https://ollie27.github.io/rust_doc_test/std/io/type.Result.html)
Previous discussions: #34345, #35003
|
|
|
|
Changes the definition for opaque structs to look like `pub struct Vec<T>
{ /* fields omitted */ }` to save space on the page.
Also only use one line for empty braced structs.
|
|
|
|
rustdoc: Filter more incorrect methods inherited through Deref
Old code filtered out only static methods. This code also excludes &mut self methods if there is no DerefMut implementation.
Fixes #35169
|
|
rustdoc: Fix associated consts in search results
Associated consts can appear in none trait impls so need to be treated
like methods when generating the search index.
Fixes #36031
|
|
Old code filtered out only static methods. This code also excludes
&mut self methods if there is no DerefMut implementation
|
|
|
|
|
|
|
|
|
|
|
|
Associated consts can appear in none trait impls so need to be treated
like methods when generating the search index.
|
|
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
|
|
|