| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
rustdoc: Preserve rendering of macro_rules matchers when possible
Fixes #92331. This approach restores the behavior prior to #86282 **if** the matcher token held by the compiler **and** the matcher token found in the source code are identical TokenTrees. Thus #86208 remains fixed, but without regressing formatting for the vast majority of macros which are not macro-generated.
|
|
rustdoc: do not emit tuple variant fields if none are documented
Fixes #90824.
Before:

After:

|
|
rustdoc: Display "private fields" instead of "fields omitted"
Also:
* Always use `/* */` block comments
* Use the same message everywhere, rather than sometimes prefixing
with "some"
When I first read rustdoc docs, I was confused why the fields were being
omitted. It was only later that I realized it was because they were
private. It's also always bothered me that rustdoc sometimes uses `//`
and sometimes uses `/*` comments for these messages, so this change
makes them all use `/*`.
Technically, I think fields can be omitted if they are public but
`doc(hidden)` too, but `doc(hidden)` is analogous to privacy. It's
really just used to emulate "doc privacy" when -- because of technical
limitations -- an item has to be public. So I think it's fine to include
this under the category of "private fields".
r? ```@jsha```
|
|
|
|
Inherent associated types *are* supported, just unstable.
|
|
|
|
Make source links look cleaner
Change from syntaxy-looking [src] to the plain word "source".
Change the syntaxy-looking `[-]` at the top of the page to say "collapse".
Reduce opacity of rightside content.
Part of #59851
r? `@GuillaumeGomez`
Demo: https://rustdoc.crud.net/jsha/source-link-2/std/string/struct.String.html
[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/display.20of.20source.20link).
|
|
r=camelid
Fix invalid removal of newlines from doc comments
Fixes https://github.com/rust-lang/rust/issues/91201.
Before:

After:

r? `@camelid`
|
|
Also:
* Always use `/* */` block comments
* Use the same message everywhere, rather than sometimes prefixing
with "some"
When I first read rustdoc docs, I was confused why the fields were being
omitted. It was only later that I realized it was because they were
private. It's also always bothered me that rustdoc sometimes uses `//`
and sometimes uses `/*` comments for these messages, so this change
makes them all use `/*`.
Technically, I think fields can be omitted if they are public but
`doc(hidden)` too, but `doc(hidden)` is analogous to privacy. It's
really just used to emulate "doc privacy" when -- because of technical
limitations -- an item has to be public. So I think it's fine to include
this under the category of "private fields".
|
|
Change from syntaxy-looking [src] to the plain word "source".
|
|
|
|
Fixes #90703
|
|
Add test for where clause order
I didn't use ``@snapshot`` because of the ` ` characters, it's much simpler doing it through rustdoc-gui testsuite.
r? `@camelid`
|
|
|
|
|
|
rustdoc: use smaller number of colors to distinguish items
This reduces visual distractions when reading method signatures.
As discussed in https://github.com/rust-lang/rust/issues/59845#issuecomment-974757191, this categorizes items into one of six colors (down from thirteen):
- method, function (ochre `#AD7C37`)
- trait, trait alias (dark slate blue `#6E4FC9`)
- enum, struct, type alias, union, primitive (maroon `#AD378A`)
- static, module, keyword, associated type, foreign type (steel blue `#3873AD`)
- macro (green `#068000`)
- generic params, self, Self (unmarked black `#000000`)
I slightly tweaked the actual color values so they'd have the same lightness (previously the trait color stood out much more than the others). And I made the color for links in general consistently use steel blue (previously there was a slightly different color for "search-failed").
The ayu and dark themes have been updated according to the same logic. I haven't changed any of the color values in those themes, just their assignment to types.
Demo:
https://rustdoc.crud.net/jsha/fewer-colors/std/string/struct.String.html
https://rustdoc.crud.net/jsha/fewer-colors/std/vec/struct.Vec.html
https://rustdoc.crud.net/jsha/fewer-colors/std/io/trait.Read.html
https://rustdoc.crud.net/jsha/fewer-colors/std/iter/trait.Iterator.html
|
|
|
|
|
|
|
|
rustdoc: make `--passes` and `--no-defaults` have no effect
Fixes #91714
One potential issue is that currently there is no stable way to achieve `--document-hidden-items`. This affects test `issue-15347`.
I also had to modify the tests `issue-42875` and `no-compiler-export`. Regardless of combinations of `--document-hidden-items` and `--document-private-items`, I was unable to get these to pass without the modifications. I left behind a comment noting the change.
|
|
- flags no longer function, see #44136
- adjust tests to match new behavior
- removed test issue-42875 (covered regression with --no-defaults)
- moved input-format to removed flags
- move all removed flags to bottom
- note flag removal in command help
- remove DefaultPassOption enum (now redundant with `show_coverage`)
|
|
Also replace ' with " in rustdoc template
|
|
Stabilize asm! and global_asm!
Tracking issue: #72016
It's been almost 2 years since the original [RFC](https://github.com/rust-lang/rfcs/pull/2850) was posted and we're finally ready to stabilize this feature!
The main changes in this PR are:
- Removing `asm!` and `global_asm!` from the prelude as per the decision in #87228.
- Stabilizing the `asm` and `global_asm` features.
- Removing the unstable book pages for `asm` and `global_asm`. The contents are moved to the [reference](https://github.com/rust-lang/reference/pull/1105) and [rust by example](https://github.com/rust-lang/rust-by-example/pull/1483).
- All links to these pages have been removed to satisfy the link checker. In a later PR these will be replaced with links to the reference or rust by example.
- Removing the automatic suggestion for using `llvm_asm!` instead of `asm!` if you're still using the old syntax, since it doesn't work anymore with `asm!` no longer being in the prelude. This only affects code that predates the old LLVM-style `asm!` being renamed to `llvm_asm!`.
- Updating `stdarch` and `compiler-builtins`.
- Updating all the tests.
r? `@joshtriplett`
|
|
Stabilise `feature(const_generics_defaults)`
`feature(const_generics_defaults)` is complete implementation wise and has a pretty extensive test suite so I think is ready for stabilisation.
needs stabilisation report and maybe an RFC :sweat_smile:
r? `@lcnr`
cc `@rust-lang/project-const-generics`
|
|
They are also removed from the prelude as per the decision in
https://github.com/rust-lang/rust/issues/87228.
stdarch and compiler-builtins are updated to work with the new, stable
asm! and global_asm! macros.
|
|
notriddle:notriddle/doc-notable_trait-mut_t_is_not_an_iterator, r=Mark-Simulacrum
rustdoc: Add regression test for Iterator as notable trait on &mut T
Closes #80737
|
|
notriddle:notriddle/doc-notable_trait-mut_t_is_not_ref_t, r=Mark-Simulacrum
rustdoc: Add regression test for Iterator as notable trait on &T
Closes #78160
This regression test is different from the one in #91748, because while neither of these function should have Iterator marked as a notable trait, the reasons are different.
* In this PR, it returns `&T where T: Iterator`. The `mut` is what's missing.
* In #91748, it returns `&mut T`. The trait bounds are what's missing.
|
|
|
|
|
|
|
|
|
|
At first, you might think, "Why not just click through to the aliased
type?" But, if a type alias instantiates all of the generic parameters
of the aliased type, then it can show layout info even though the
aliased type cannot (because we can't compute layout for generic types).
So, I think it's useful to show layout info for type aliases.
This is a followup of 78d4b453ad2e19d44011b26fc55c949bff5dba3d
(originally part of #83501).
|
|
Improve rustdoc layout
This is an overtake of https://github.com/rust-lang/rust/pull/89385 originally written by `@cynecx.`
I kept the original commit and simply added the missing fixes into a new one. You can test it online [here](https://rustdoc.crud.net/imperio/improve-rustdoc-layout/std/index.html).
r? `@jsha`
|
|
Implement `@snapshot` check for htmldocck
This form of check allows performing snapshot tests (à la `src/test/ui`)
on rustdoc HTML output, making it easier to create and update tests.
See [this Zulip thread][1] for more information about the motivation for
this change.
[1]: https://zulip-archive.rust-lang.org/stream/266220-rustdoc/topic/HTML.20snapshot.20tests.html#262651142
r? `@GuillaumeGomez`
|
|
Fix legacy_const_generic doc arguments display
Fixes https://github.com/rust-lang/rust/issues/83167.
cc ``@Amanieu``
|
|
|
|
|
|
Fix const deref methods display
Fixes https://github.com/rust-lang/rust/issues/90855 (more information in the issue).
r? `@camelid`
|
|
I'd been thinking about implementing snapshot testing for a while, but
This test is what finally made me do it. It really benefits from using
snapshot testing, so it's a good initial place to use `@snapshot`.
|
|
Deny warnings in rustdoc non-UI tests
These warnings were silently ignored since they did not appear in a
`.stderr` file and did not fail the test. With this change, warnings in
tests are denied, causing the tests to fail if they have warnings.
This change has already led me to find a bug in rustdoc (#91274) and a
useless test (`src/test/rustdoc/primitive/primitive-generic-impl.rs`,
though its uselessness is unrelated to its warnings).
r? `@jyn514`
|
|
|
|
Checking only their DefId doesn't work because all slices have the same
fake DefId.
Fixes #91347
|
|
Using `include!` shouldn't affect the test. It was only added because:
> I replicated how it was performed in libstd. Since it's the main
> target of this fix, I thought it was the best way.
<https://github.com/rust-lang/rust/pull/52827/files#r207647331>
But it's unnecessary and adds unnecessary indirection.
|
|
Now that compiletest denies warnings in these tests, they need fixing!
|
|
|
|
rustdoc: Add test for mixing doc comments and attrs
This is a step toward adding more test coverage to make it easier to
remove the distinction between collapsed and uncollapsed doc values.
|