about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2016-11-14rustdoc: Fix some local inlining issuesOliver Middleton-0/+173
* Only inline public items when inlining glob imports. * Never inline while in a private module or a child of a private module. * Never inline impls. This allowed the removal of a workaround in the rendering code.
2016-11-13do not use deprecated text for unstable docsAndy Russell-0/+10
2016-11-12Rollup merge of #37190 - QuietMisdreavus:rustdoc-where-newline, r=GuillaumeGomezEduard-Mihai Burtescu-0/+19
rustdoc: add line breaks to where clauses a la rustfmt Much like my last PR for rustdoc (#36679), this adds line breaks to certain statements based on their line length. Here the focus was on where clauses. Some examples: - [Where clause in a trait function](https://shiva.icesoldier.me/custom-std/std/iter/trait.Iterator.html?search=#method.unzip) (also in the trait header block at the top of the page) - [Where clause on a bare function](https://shiva.icesoldier.me/doc-custom2/petgraph/visit/fn.depth_first_search.html) - [Where clauses in trait impls on a struct](https://shiva.icesoldier.me/custom-std/std/collections/struct.HashMap.html) (scroll to the bottom) These are regularly not on their own line, but will be given their own line now if their "prefix text" doesn't give them enough room to sensibly print their constraints. HashMap's trait impls provide some examples of both behaviors. The libstd links above are the whole docs rendered with this, and the "bare function" link above is in another set that pulls some notable crates together. `petgraph` was the one that brought this request up, and that collection also includes [itertools](https://shiva.icesoldier.me/doc-custom2/itertools/trait.Itertools.html) which provided an easy sample to test with. r? @GuillaumeGomez
2016-10-15rustdoc: Improve playground run buttonsOliver Middleton-0/+79
The main change is to stop using javascript to generate the URLs and use rustdoc instead. This also adds run buttons to the error index examples.
2016-10-13rustdoc: add line breaks to where clauses a la rustfmtQuietMisdreavus-0/+19
2016-10-11Rollup merge of #36679 - QuietMisdreavus:rustdoc-line-breaks, r=steveklabnikGuillaume Gomez-0/+21
rustdoc: print non-self arguments of bare functions and struct methods on their own line This change alters the formatting rustdoc uses when it creates function and struct method documentation. For bare functions, each argument is printed on its own line. For struct methods, non-self arguments are printed on their own line. In both cases, no line breaks are introduced if there are no arguments, and for struct methods, no line breaks are introduced if there is only a single self argument. This should aid readability of long function signatures and allow for greater comprehension of these functions. I've run rustdoc with these changes on my crate egg-mode and its set of dependencies and put the result [on my server](https://shiva.icesoldier.me/doc-custom/egg_mode/). Of note, here are a few shortcut links that highlight the changes: * [Bare function with a long signature](https://shiva.icesoldier.me/doc-custom/egg_mode/place/fn.reverse_geocode.html) * [Struct methods, with single self argument and with self and non-self arguments](https://shiva.icesoldier.me/doc-custom/egg_mode/tweet/struct.Timeline.html#method.reset) * [Bare functions with no arguments](https://shiva.icesoldier.me/doc-custom/rand/fn.thread_rng.html) and [struct methods with no arguments](https://shiva.icesoldier.me/doc-custom/hyper/client/struct.Client.html#method.new) are left unchanged. This PR consists of two commits: one for bare functions and one for struct methods.
2016-10-06rustc: Rename rustc_macro to proc_macroAlex Crichton-6/+6
This commit blanket renames the `rustc_macro` infrastructure to `proc_macro`, which reflects the general consensus of #35900. A follow up PR to Cargo will be required to purge the `rustc-macro` name as well.
2016-09-30rustdoc: Fix documenting rustc-macro cratesAlex Crichton-0/+24
This commit adds a "hack" to the session to track whether we're a rustdoc session or not. If we're rustdoc then we skip the expansion to add the rustc-macro infrastructure. Closes #36820
2016-09-27add rustdoc test for adding line breaksQuietMisdreavus-0/+21
2016-09-14Auto merge of #36293 - liigo:docblock-short, r=steveklabnikbors-1/+1
rustdoc: don't collapse `docblock-short` ![docblock-short](https://cloud.githubusercontent.com/assets/346530/18267298/137d2542-7451-11e6-9c8e-dd4e1f1fea29.png)
2016-09-14Auto merge of #35667 - ollie27:rustdoc_opaque_structs, r=steveklabnikbors-0/+10
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
2016-09-10Rollup merge of #36045 - ollie27:rustdoc_titles3, r=steveklabnikGuillaume Gomez-0/+59
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
2016-09-09rustdoc: don't collapse `docblock-short`Liigo-1/+1
2016-09-09rustdoc: Don't add extra newlines for fully opaque structsOliver Middleton-0/+10
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.
2016-09-08Auto merge of #35745 - jroesch:soundness-fix-29859, r=nikomatsakisbors-1/+1
Fix soundness bug described in #29859 This is an attempt at fixing the problems described in #29859 based on an IRC conversation between @nikomatsakis and I today. I'm waiting on a full build to come back, otherwise both tests trigger the correct error.
2016-09-07Auto merge of #36266 - Sawyer47:issue-35169, r=alexcrichtonbors-0/+85
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
2016-09-05Auto merge of #36078 - ollie27:rustdoc_search_assocconst, r=alexcrichtonbors-0/+40
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
2016-09-05rustdoc: Filter more incorrect methods inherited through DerefPiotr Jawniak-0/+85
Old code filtered out only static methods. This code also excludes &mut self methods if there is no DerefMut implementation
2016-09-03Support unions in rustdocVadim Petrochenkov-0/+20
2016-09-02Remove illegal bound from doc testJared Roesch-1/+1
2016-08-29rustdoc: Fix associated consts in search resultsOliver Middleton-0/+40
Associated consts can appear in none trait impls so need to be treated like methods when generating the search index.
2016-08-27rustdoc: Add missing item types to page titlesOliver Middleton-0/+59
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.
2016-08-19RedirectNick Cameron-0/+2
2016-08-18rustdoc: remove the `!` from macro URLs and titlesNick Cameron-2/+2
2016-08-17Review changesNick Cameron-0/+17
2016-08-11Make `private_in_public` compatibility lint deny-by-defaultVadim Petrochenkov-2/+4
2016-08-11Add test for recursive private alias substitution in rustdocVadim Petrochenkov-0/+11
2016-08-11Substitute private type aliases in rustdocpetrochenkov-0/+30
2016-07-25rustdoc: Fix tuple struct where clause renderingOliver Middleton-1/+17
For tuple structs the where clause comes after the definition.
2016-07-13Auto merge of #34684 - oli-obk:eval_rustdoc_array_len, r=alexcrichtonbors-2/+2
evaluate the array length of fixed size array types in rustdoc mitgates #34579 to fix it we'd need an expression simplifier. r? @steveklabnik cc @Osspial
2016-07-13evaluate the array length of fixed size array types in rustdocOliver Schneider-2/+2
2016-07-12rustdoc: Fix methods in seach resultsOliver Middleton-0/+42
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.
2016-06-30rustdoc: Remove paths from primitive page <title> tagsOliver Middleton-0/+17
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.
2016-06-29Rollup merge of #34536 - ollie27:rustdoc_module_impls, r=alexcrichtonManish Goregaokar-0/+15
rustdoc: Fix empty Implementations section on some module pages These are caused by `DefaultImpl`s. For example [`core::marker`](https://doc.rust-lang.org/nightly/core/marker/#impls).
2016-06-29Rollup merge of #34513 - ollie27:rustdoc_stripped, r=alexcrichtonManish Goregaokar-0/+66
rustdoc: Fix a few stripping issues We need to recurse into stripped modules to strip things like impl methods but when doing so we must not add any items to the `retained` set. For example this removes [`core::num::ParseFloatError::__description`](https://doc.rust-lang.org/nightly/core/num/struct.ParseFloatError.html#method.__description) and [`impl Clone for ThreadRng`](https://doc.rust-lang.org/nightly/std/clone/trait.Clone.html).
2016-06-28rustdoc: Fix empty Implementations section on some module pagesOliver Middleton-0/+15
These are caused by `DefaultImpl`s.
2016-06-27rustdoc: Fix a few stripping issuesOliver Middleton-0/+66
We need to recurse into stripped modules to strip things like impl methods but when doing so we must not add any items to the `retained` set.
2016-06-26rustdoc: Fix inlined renamed reexports in import listsOliver Middleton-0/+22
2016-06-23rustdoc: Fix panic caused by doc(hidden) trait methodsOliver Middleton-0/+20
2016-06-20rustdoc: Fix a couple of issues with src links to external cratesOliver Middleton-0/+66
- 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.
2016-06-17Auto merge of #34292 - ollie27:rustdoc_depr_impl, r=GuillaumeGomezbors-0/+128
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.
2016-06-15rustdoc: Add stability notices to impl itemsOliver Middleton-0/+128
Also fixes missing stability notices on methods with no docs.
2016-06-14Auto merge of #34245 - ollie27:rustdoc_redirect_rename, r=alexcrichtonbors-0/+32
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).
2016-06-14rustdoc: Fix redirect pages for renamed reexportsOliver Middleton-0/+32
We need to use the name of the target not the name of the current item when creating the link.
2016-06-14Auto merge of #34232 - ollie27:rustdoc_inline, r=alexcrichtonbors-0/+42
rustdoc: Don't inline #[doc(hidden)] pub use Currently if a `#[doc(hidden)] pub use` item is inlined the `hidden` attribute is ignored so the item can appear in the docs. By never inlining such imports, they can be stripped. An example in `std` is [`__OsLocalKeyInner`](https://doc.rust-lang.org/nightly/std/thread/struct.__OsLocalKeyInner.html) which clearly should not be documented.
2016-06-12Auto merge of #34045 - ollie27:rustdoc_stripped, r=brsonbors-0/+22
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
2016-06-11rustdoc: Don't inline #[doc(hidden)] pub useOliver Middleton-0/+42
Currently if a `#[doc(hidden)] pub use` item is inlined the `hidden` attribute is ignored so the item can appear in the docs. By never inlining such imports, they can be stripped.
2016-06-03rustdoc: Fix generating redirect pages for statics and constsOliver Middleton-0/+23
These were missing from the cache for some reason meaning the redirect pages failed to render.
2016-06-02rustdoc: Don't generate empty files for stripped itemsOliver Middleton-0/+22
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.
2016-05-20Update testsManish Goregaokar-6/+19