about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2017-12-19Add a test for `--sort-modules-by-appearance`varkor-0/+23
2017-12-18Add tests for hidden typesGuillaume Gomez-0/+32
2017-12-18Fix ?Sized where bound not being displayed at the correct placeGuillaume Gomez-0/+16
2017-12-03Auto merge of #46384 - ollie27:rustdoc_inline_assoc, r=QuietMisdreavusbors-0/+105
rustdoc: Fix issues with cross-crate inlined associated items * Visibility was missing from impl items. * Attributes and docs were missing from consts and types in impls. * Const default values were missing from traits. This unifies the code that handles associated items from impls and traits.
2017-12-02Auto merge of #46326 - GuillaumeGomez:sidebar-text, r=QuietMisdreavusbors-0/+23
Fix invalid HTML escape Fixes #46289. r? @QuietMisdreavus
2017-12-02Rollup merge of #46412 - chrisduerr:issue-46380, r=QuietMisdreavuskennytm-0/+34
Hide private trait type params and show hidden items with document-private As discussed in #46380, this PR removes the `strip-hidden` pass from `--document-private-items` which allows showing `#[doc(hidden)]` with rustdoc. The second commit removes the trait implementation from the docs if the trait's parameter is private.
2017-12-02Rollup merge of #46405 - alexcrichton:fix-rustdoc, r=estebankkennytm-0/+15
rustc: Filter out bogus extern crate warnings Rustdoc has for some time now used the "everybody loops" pass in the compiler to avoid typechecking and otherwise avoid looking at implementation details. In #46115 the placement of this pass was pushed back in the compiler to after macro expansion to ensure that it works with macro-expanded code as well. This in turn caused the regression in #46271. The bug here was that the resolver was producing `def_id` instances for "possibly unused extern crates" which would then later get processed during typeck to actually issue lint warnings. The problem was that *after* resolution these `def_id` nodes were actually removed from the AST by the "everybody loops" pass. This later, when we tried to take a look at `def_id`, caused the compiler to panic. The fix applied here is a bit of a heavy hammer which is to just, in this one case, ignore the `extern crate` lints if the `def_id` looks "bogus" in any way (basically if it looks like the node was removed after resolution). The real underlying bug here is probably that the "everybody loops" AST pass is being stressed to much beyond what it was originally intended to do, but this should at least fix the ICE for now... Closes #46271
2017-11-30Fix htmldocck namingChristian Duerr-2/+2
After renaming the structs and enums the htmldocck strings still contained the old names. This lead to test failure. These htmldocck tests have been updated to use the proper names of the rust structs and traits.
2017-11-30Hide trait impl with private trait type parameterChristian Duerr-0/+19
Trait's implementations with private type parameters were displayed in the implementing struct's documentation until now. With this change any trait implementation that uses a private type parameter is now hidden in the docs.
2017-11-30Show hidden items with rustdoc's document-privateChristian Duerr-0/+15
When using `#[doc(hidden)]` elements are hidden from docs even when the rustdoc flag `--document-private-items` is set. This behavior has been changed to display all hidden items when the flag is active.
2017-11-30rustc: Filter out bogus extern crate warningsAlex Crichton-0/+15
Rustdoc has for some time now used the "everybody loops" pass in the compiler to avoid typechecking and otherwise avoid looking at implementation details. In #46115 the placement of this pass was pushed back in the compiler to after macro expansion to ensure that it works with macro-expanded code as well. This in turn caused the regression in #46271. The bug here was that the resolver was producing `def_id` instances for "possibly unused extern crates" which would then later get processed during typeck to actually issue lint warnings. The problem was that *after* resolution these `def_id` nodes were actually removed from the AST by the "everybody loops" pass. This later, when we tried to take a look at `def_id`, caused the compiler to panic. The fix applied here is a bit of a heavy hammer which is to just, in this one case, ignore the `extern crate` lints if the `def_id` looks "bogus" in any way (basically if it looks like the node was removed after resolution). The real underlying bug here is probably that the "everybody loops" AST pass is being stressed to much beyond what it was originally intended to do, but this should at least fix the ICE for now... Closes #46271
2017-11-30Fix rustoc item summaries that are headersChristian Duerr-0/+13
Rustoc item summaries that are headers were not displayed at all because they started with whitespace. This PR fixes this and now removes the whitespace and then displays the block.
2017-11-29rustdoc: Fix issues with cross-crate inlined associated itemsOliver Middleton-0/+105
* Visibility was missing from impl items. * Attributes and docs were missing from consts and types in impls. * Const default values were missing from traits. This unifies the code that handles associated items from impls and traits.
2017-11-29Fix invalid HTML escapeGuillaume Gomez-0/+23
2017-11-25Auto merge of #46129 - kennytm:fix-46098-rustdoc-reexport-extern-type, ↵bors-0/+66
r=GuillaumeGomez Properly handle reexport of foreign items. Handles `pub use` of `extern { fn, static, type }`. Also plug in some more `match` arms where handling `extern type` is reasonable. Fixed #46098.
2017-11-22Auto merge of #44781 - QuietMisdreavus:doc-include, r=GuillaumeGomezbors-0/+82
rustdoc: include external files in documentation (RFC 1990) Part of https://github.com/rust-lang/rfcs/pull/1990 (needs work on the error reporting, which i'm deferring to after this initial PR) cc #44732 Also fixes #42760, because the prep work for the error reporting made it easy to fix that at the same time.
2017-11-21allow loading external files in documentationQuietMisdreavus-0/+82
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990 (needs error reporting work) cc #44732
2017-11-22Rollup merge of #46134 - GuillaumeGomez:negative-traits, r=QuietMisdreavuskennytm-0/+19
Display negative traits implementation Fixes #45816. r? @QuietMisdreavus
2017-11-21Auto merge of #45039 - QuietMisdreavus:doc-spotlight, ↵bors-0/+46
r=GuillaumeGomez,QuietMisdreavus show in docs whether the return type of a function impls Iterator/Read/Write Closes #25928 This PR makes it so that when rustdoc documents a function, it checks the return type to see whether it implements a handful of specific traits. If so, it will print the impl and any associated types. Rather than doing this via a whitelist within rustdoc, i chose to do this by a new `#[doc]` attribute parameter, so things like `Future` could tap into this if desired. ### Known shortcomings ~~The printing of impls currently uses the `where` class over the whole thing to shrink the font size relative to the function definition itself. Naturally, when the impl has a where clause of its own, it gets shrunken even further:~~ (This is no longer a problem because the design changed and rendered this concern moot.) The lookup currently just looks at the top-level type, not looking inside things like Result or Option, which renders the spotlights on Read/Write a little less useful: <details><summary>`File::{open, create}` don't have spotlight info (pic of old design)</summary> ![image](https://user-images.githubusercontent.com/5217170/31209495-e59d027e-a950-11e7-9998-ceefceb71c07.png) </details> All three of the initially spotlighted traits are generically implemented on `&mut` references. Rustdoc currently treats a `&mut T` reference-to-a-generic as an impl on the reference primitive itself. `&mut Self` counts as a generic in the eyes of rustdoc. All this combines to create this lovely scene on `Iterator::by_ref`: <details><summary>`Iterator::by_ref` spotlights Iterator, Read, and Write (pic of old design)</summary> ![image](https://user-images.githubusercontent.com/5217170/31209554-50b271ca-a951-11e7-928b-4f83416c8681.png) </details>
2017-11-20Display negative traits implementationGuillaume Gomez-0/+19
2017-11-21Properly handle reexport of foreign items.kennytm-0/+66
Handles `pub use` of `extern { fn, static, type }`. Also plug in some more `match` arms where handling `extern type` is reasonable. Fixed #46098.
2017-11-20Make rustdoc not include self-by-value methods from Deref targetFlorian Hartwig-8/+8
2017-11-18Add tooltip for important traits displayGuillaume Gomez-4/+4
2017-11-18Auto merge of #46000 - kennytm:fix-45640-extern-type-ice-in-rustdoc, ↵bors-0/+28
r=QuietMisdreavus Support `extern type` in rustdoc. Fixes #45640. (cc #43467)
2017-11-17add doc_highlight feature flag and testsQuietMisdreavus-0/+46
2017-11-15Remove Fn trait + impl Trait rustdoc testsChristopher Vittal-5/+9
2017-11-15Add/Modify tests for argument position impl TraitChristopher Vittal-4/+0
2017-11-15Support `extern type` in rustdoc.kennytm-0/+28
Fixes #45640.
2017-11-14Rollup merge of #45815 - QuietMisdreavus:happy-little-notices, r=GuillaumeGomezGuillaume Gomez-2/+2
rustdoc: tweak notes on ignore/compile_fail examples Part of https://github.com/rust-lang/rust/issues/44927 This is a softening of these notices to mention *why* a given example has a given callout, rather then telling viewers to be careful with an example. It also changes the character used for these samples from a warning logo to a circle-i/information logo. ![image](https://user-images.githubusercontent.com/5217170/32464361-5fbb5d9e-c305-11e7-8482-ce71b97a54df.png)
2017-11-13update codeblock-title test with new notice textQuietMisdreavus-2/+2
2017-11-07Add more elements in the sidebarGuillaume Gomez-0/+59
2017-11-07Rollup merge of #45764 - QuietMisdreavus:rustdoc-doctest-lints, r=GuillaumeGomezkennytm-4/+4
rustdoc: add #[allow(unused)] to every doctest More information in #45750 - this is behavior that was documented but not actually implemented. I also reordered how outer attributes are applied to doctests. Previously, attributes from `#![doc(test(attr(...)))]` would be applied *after* attributes from within the test itself, meaning if a doctest tried to override lints that would be set crate-wide, it wouldn't work at all. This gives a better scope of how lints can be applied. Closes #45750
2017-11-07Auto merge of #45620 - ollie27:rustdoc_impl_generic_dupe, r=QuietMisdreavusbors-0/+25
rustdoc: Fix duplicated impls with generics The same type can appear multiple times in impls so we need to use a set to avoid adding it multiple times. Fixes: #45584
2017-11-05add #![allow(unused)] to the playground link rustdoc testsQuietMisdreavus-4/+4
2017-11-04Rollup merge of #45746 - GuillaumeGomez:methods-doc-test, r=steveklabnikkennytm-0/+30
Add tests for methods listing in rust docs r? @rust-lang/docs
2017-11-03auto trait future compatibility lintleonardo.yvens-0/+3
2017-11-03Add tests for methods listing in rust docsGuillaume Gomez-0/+30
2017-10-29rustdoc: Fix duplicated impls with genericsOliver Middleton-0/+25
The same type can appear multiple times in impls so we need to use a set to avoid adding it multiple times.
2017-10-17modify tests to use new flagsteveklabnik-3/+3
2017-10-13Rollup merge of #44989 - QuietMisdreavus:what-is-your-quest, r=GuillaumeGomezkennytm-0/+13
let rustdoc print the crate version into docs This PR adds a new unstable flag to rustdoc, `--crate-version`, which when present will add a new entry to the sidebar of the root module, printing the given version number: ![Screenshot of a test crate, showing "Version 1.3.37" under the crate name](https://user-images.githubusercontent.com/5217170/31104096-805e3f4c-a7a0-11e7-96fc-368b6fe063d6.png) Closes #24336 (The WIP status is because i don't want to merge this until i can get the std docs to use it, which i need help from rustbuild people to make sure i get right.)
2017-10-09let rustdoc print the crate version into docsQuietMisdreavus-0/+13
2017-10-07Auto merge of #44892 - GuillaumeGomez:fnty-args-rustdoc, r=eddybbors-0/+15
Fnty args rustdoc Fixes #44570. cc @QuietMisdreavus cc @rust-lang/dev-tools Considering the impact on the `hir` libs, I'll put @eddyb as reviewer. r? @eddyb
2017-10-07Fix invalid rustdoc rendering for FnTy argsGuillaume Gomez-0/+15
2017-10-07Auto merge of #44860 - kennytm:fix-44731, r=alexcrichtonbors-0/+51
Fix issue #44731. Also excludes `impl Trait` from everybody_loops if it appears in the path. Fixes #44731.
2017-10-03Auto merge of #44949 - QuietMisdreavus:rustdoctest-dirs, r=nikomatsakisbors-0/+3
let htmldocck.py check for directories Since i messed this up during https://github.com/rust-lang/rust/pull/44613, i wanted to codify this into the rustdoc tests to make sure that doesn't happen again.
2017-10-02rustdoc: Remove cruft from the testVitaly _Vi Shukela-14/+4
per @GuillaumeGomez's sample, but with one change.
2017-09-30let htmldocck.py check for directoriesQuietMisdreavus-0/+3
2017-09-30rustdoc: A test for local and foreign [src] trait impl linksVitaly _Vi Shukela-0/+34
2017-09-26Fix issue #44731.kennytm-0/+51
Also excludes `impl Trait` from everybody_loops if it appears in the path.
2017-09-23Rollup merge of #44554 - GuillaumeGomez:add-missing-pub, r=QuietMisdreavusCorey Farwell-0/+31
Add pub visibility for methods as well Fixes #44527. r? @QuietMisdreavus