about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2022-01-15Add test for dot separatorGuillaume Gomez-0/+31
2022-01-13rustdoc: add intra-doc trait impl test for extern typesMahdi Dibaiee-2/+23
2022-01-13rustdoc: fix intra-link for generic trait implsMahdi Dibaiee-0/+19
2022-01-13rustdoc: decouple stability and const-stabilityAndy Russell-1/+18
2022-01-13Rollup merge of #92334 - dtolnay:rustdocmatcher, r=camelid,GuillaumeGomezMatthias Krüger-16/+30
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.
2022-01-13Rollup merge of #91687 - euclio:tuple-variant-field-section, r=GuillaumeGomezMatthias Krüger-2/+17
rustdoc: do not emit tuple variant fields if none are documented Fixes #90824. Before: ![2021-12-15T22:26:41](https://user-images.githubusercontent.com/1372438/146302871-4d265433-b9aa-4e53-adfb-e7cb92107180.png) After: ![2021-12-15T22:27:01](https://user-images.githubusercontent.com/1372438/146302872-e39eda3d-2fb2-4fb9-aae7-2008e4e1b4dd.png)
2022-01-12Rollup merge of #92699 - camelid:private-fields, r=jshaMatthias Krüger-6/+6
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```
2022-01-11rustdoc: do not emit tuple variant fields if none are documentedAndy Russell-2/+17
2022-01-10Enable ignored part of testNoah Lev-4/+5
Inherent associated types *are* supported, just unstable.
2022-01-10Move two intra-doc-link tests into the `intra-doc` folderNoah Lev-1/+1
2022-01-10Rollup merge of #92602 - jsha:source-link-2, r=GuillaumeGomezMatthias Krüger-19/+21
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).
2022-01-10Rollup merge of #92357 - GuillaumeGomez:fix-doc-comment-backline-removal, ↵Matthias Krüger-2/+12
r=camelid Fix invalid removal of newlines from doc comments Fixes https://github.com/rust-lang/rust/issues/91201. Before: ![Screenshot from 2021-12-28 17-02-11](https://user-images.githubusercontent.com/3050060/147585187-c8e67531-c1b4-457d-9d30-d5b44bf91fea.png) After: ![Screenshot from 2021-12-28 17-02-25](https://user-images.githubusercontent.com/3050060/147585190-30aa0398-1fc7-4fe7-9e8b-5c475d4f9613.png) r? `@camelid`
2022-01-09Display "private fields" instead of "fields omitted"Noah Lev-6/+6
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".
2022-01-08Make source links look cleanerJacob Hoffman-Andrews-19/+21
Change from syntaxy-looking [src] to the plain word "source".
2022-01-05add a test case for each supported primitive typeMahdi Dibaiee-3/+42
2022-01-05Rustdoc: resolve associated traits for primitive typesMahdi Dibaiee-0/+7
Fixes #90703
2022-01-01Rollup merge of #92332 - GuillaumeGomez:where-clause-order, r=jshaMatthias Krüger-0/+15
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`
2022-01-01Update mixed doc comments testGuillaume Gomez-0/+10
2022-01-01Add test for where clause orderGuillaume Gomez-0/+15
2021-12-31Rollup merge of #91480 - jsha:fewer-colors, r=GuillaumeGomezMatthias Krüger-6/+4
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
2021-12-28Add a test of rustdoc on macro-generated macroDavid Tolnay-0/+14
2021-12-28Fix invalid removal of backlines from doc commentsGuillaume Gomez-2/+2
2021-12-27rustdoc: Preserve rendering of macro_rules matchers when possibleDavid Tolnay-16/+16
2021-12-20Auto merge of #91900 - pitaj:fix-91714, r=jyn514bors-19/+6
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.
2021-12-15rustdoc: remove `--passes` and `--no-defaults`Peter Jaszkowiak-19/+6
- 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`)
2021-12-15Apply rust-logo class only on default logoJacob Hoffman-Andrews-0/+14
Also replace ' with " in rustdoc template
2021-12-14Auto merge of #91728 - Amanieu:stable_asm, r=joshtriplettbors-2/+2
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`
2021-12-12Auto merge of #90207 - BoxyUwU:stabilise_cg_defaults, r=lcnrbors-1/+0
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`
2021-12-12Stabilize asm! and global_asm!Amanieu d'Antras-2/+2
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.
2021-12-12Rollup merge of #91748 - ↵Matthias Krüger-0/+23
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
2021-12-11Rollup merge of #91750 - ↵Matthias Krüger-0/+21
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.
2021-12-10Split CSS classes for "typedef" vs "associatedtype".Jacob Hoffman-Andrews-6/+4
2021-12-10update testsEllen-1/+0
2021-12-10Add regression test for #78160Michael Howell-0/+21
2021-12-10Add regression test for #80737Michael Howell-0/+23
2021-12-08rustdoc: Show type layout for type aliasesNoah Lev-0/+12
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).
2021-12-05Auto merge of #91356 - GuillaumeGomez:improve-rustdoc-layout, r=jshabors-52/+49
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`
2021-12-04Rollup merge of #91209 - camelid:snapshot, r=jyn514Matthias Krüger-10/+10
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`
2021-12-02Rollup merge of #89954 - GuillaumeGomez:legacy-const-generic-doc, r=AmanieuMatthias Krüger-0/+16
Fix legacy_const_generic doc arguments display Fixes https://github.com/rust-lang/rust/issues/83167. cc ``@Amanieu``
2021-12-02Rename ID "main" into "main-content"Guillaume Gomez-52/+49
2021-12-02Add test for legacy-const-generic argumentsGuillaume Gomez-0/+16
2021-12-02Auto merge of #91291 - GuillaumeGomez:const-deref-method, r=camelidbors-0/+38
Fix const deref methods display Fixes https://github.com/rust-lang/rust/issues/90855 (more information in the issue). r? `@camelid`
2021-12-01Migrate a test to use `@snapshot`Noah Lev-10/+10
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`.
2021-12-01Auto merge of #91275 - camelid:deny-test-warnings, r=jyn514bors-97/+92
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`
2021-11-30Add test for const deref methods displayGuillaume Gomez-0/+38
2021-11-29Only show notable traits if both types are the sameMichael Howell-0/+20
Checking only their DefId doesn't work because all slices have the same fake DefId. Fixes #91347
2021-11-28Remove unnecessary use of `include!` in rustdoc testNoah Lev-8/+3
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.
2021-11-28Fix warnings in rustdoc HTML testsNoah Lev-92/+92
Now that compiletest denies warnings in these tests, they need fixing!
2021-11-24Consistentize the system for image URLs in CSS.Jacob Hoffman-Andrews-1/+1
2021-11-24Rollup merge of #91199 - camelid:test-mixing-docs, r=GuillaumeGomezGuillaume Gomez-0/+26
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.