about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2019-06-19Rollup merge of #61505 - ebarnard:doc-shrink, r=GuillaumeGomezMazdak Farrokhzad-8/+13
Only show methods that appear in `impl` blocks in the Implementors sections of trait doc pages In the "Implementors" and "Implementations on Foreign Types" sections, only show methods that appear in the `impl` block for that type. This has the benefit of - Reducing the size of the Iterator page, and other large trait documentation pages. - Retaining documentation on the `impl` blocks and functions in the `impl` blocks. - Indicating which provided methods are overridden. - Making the documentation match the structure of the code being documented. - Being a small change that can be easily backed out if issues arise. A set of Rust stdlib docs build with this change are [available here](https://ebarnard.github.io/2019-06-03-rust-smaller-trait-implementers-docs/). The size of the [`Iterator` doc page](https://ebarnard.github.io/2019-06-03-rust-smaller-trait-implementers-docs/std/iter/trait.Iterator.html) is reduced from 14.4MB (latest nightly) to 724kB. Before: <img width="1411" alt="Screenshot 2019-06-03 at 23 12 17" src="https://user-images.githubusercontent.com/1059683/58837971-1722a780-8655-11e9-8d81-51e48130951d.png"> After: <img width="1428" alt="Screenshot 2019-06-03 at 16 41 27" src="https://user-images.githubusercontent.com/1059683/58814907-84ffac80-861e-11e9-8692-79be473a5299.png"> cc #55900
2019-06-11rustdoc: deny(unused_lifetimes).Eduard-Mihai Burtescu-1/+1
2019-06-03Only show methods that appear in the impl block for types in the ↵Edward Barnard-8/+13
Implementors and Implementations on Foreign Types sections of trait documentation pages.
2019-06-01Rollup merge of #61263 - GuillaumeGomez:valid-html, r=ManishearthMazdak Farrokhzad-1/+1
Don't generate div inside header (h4/h3/h...) elements Fixes #60865. According to the HTML spec, we're not supposed to put `div` elements inside heading elements (h4/h3/h...). It doesn't change the display as far as I could tell. r? @QuietMisdreavus
2019-05-29Don't generate div inside header (h4/h3/h...) elementsGuillaume Gomez-1/+1
2019-05-26Rename "Associated*" to "Assoc*"Andrew Xu-12/+12
We are going to uniform the terminology of all associated items. Methods that may or may not have `self` are called "associated functions". Because `AssociatedFn` is a bit long, we rename `Associated` to `Assoc`.
2019-05-19Auto merge of #60065 - QuietMisdreavus:async-move-doctests, r=ollie27bors-6/+12
rustdoc: set the default edition when pre-parsing a doctest Fixes https://github.com/rust-lang/rust/issues/59313 (possibly more? i think we've had issues with parsing edition-specific syntax in doctests at some point) When handling a doctest, rustdoc needs to parse it beforehand, so that it can see whether it declares a `fn main` or `extern crate my_crate` explicitly. However, while doing this, rustdoc doesn't set the "default edition" used by the parser like the regular compilation runs do. This caused a problem when parsing a doctest with an `async move` block in it, since it was expecting the `move` keyword to start a closure, not a block. This PR changes the `rustdoc::test::make_test` function to set the parser's default edition while looking for a main function and `extern crate` statement. However, to do this, `make_test` needs to know what edition to set. Since this is also used during the HTML rendering process (to make playground URLs), now the HTML renderer needs to know about the default edition. Upshot: rendering standalone markdown files can now accept a "default edition" for their doctests with the `--edition` flag! (I'm pretty sure i waffled around how to set that a long time ago when we first added the `--edition` flag... `>_>`) I'm posting this before i stop for the night so that i can write this description while it's still in my head, but before this merges i want to make sure that (1) the `rustdoc-ui/failed-doctest-output` test still works (i expect it doesn't), and (2) i add a test with the sample from the linked issue.
2019-05-19Rollup merge of #60931 - cuviper:array-iter, r=KodrAusMazdak Farrokhzad-1/+1
Use iter() for iterating arrays by slice These `into_iter()` calls will change from iterating references to values if we ever get `IntoIterator` for arrays, which may break the code using that iterator. Calling `iter()` is future proof.
2019-05-18Auto merge of #60093 - GuillaumeGomez:fix-attrs-pos, r=Manishearthbors-25/+42
Fix attrs pos Fixes #60042. Screenshot: <img width="438" alt="Screenshot 2019-05-12 at 15 02 25" src="https://user-images.githubusercontent.com/3050060/57582606-1455ec00-74c7-11e9-9d4e-5ec4da4de7dd.png"> r? @rust-lang/rustdoc
2019-05-17Use iter() for iterating arrays by sliceJosh Stone-1/+1
These `into_iter()` calls will change from iterating references to values if we ever get `IntoIterator` for arrays, which may break the code using that iterator. Calling `iter()` is future proof.
2019-05-14Add comment to explain what is the top parameterGuillaume Gomez-0/+8
2019-05-13Return a `Symbol` from `name_or_empty` functions.Nicholas Nethercote-17/+17
2019-05-13Pass a `Symbol` to `check_name`, `emit_feature_err`, and related functions.Nicholas Nethercote-5/+6
2019-05-06set the default edition when pre-parsing a doctestQuietMisdreavus-6/+12
2019-05-03use span instead of div for since versionAndy Russell-1/+1
2019-04-29Revert "Update Source Code Pro fonts to version 2.030"Manish Goregaokar-1/+1
This reverts commit 6bafc58cedc6f409dbcd8919a25b2f5d425f42ae.
2019-04-26Make "Implementations on Foreign Types" items in sidebar link to specific implsDmitry Murzin-11/+19
2019-04-26Auto merge of #60167 - varkor:tidy-filelength, r=matthewjasperbors-0/+2
Add a tidy check for files with over 3,000 lines Files with a large number of lines can cause issues in GitHub (e.g. https://github.com/rust-lang/rust/issues/60015) and also tend to be indicative of opportunities to refactor into less monolithic structures. This adds a new check to tidy to warn against files that have more than 3,000 lines, as suggested in https://github.com/rust-lang/rust/issues/60015#issuecomment-483868594. (This number was chosen fairly arbitrarily as a reasonable indicator of size.) This check can be ignored with `// ignore-tidy-filelength`. Existing files with greater than 3,000 lines currently ignore the check, but this helps us spot when files are getting too large. (We might try to split up all files larger than this in the future, as in https://github.com/rust-lang/rust/issues/60015).
2019-04-26Rollup merge of #60134 - GuillaumeGomez:fix-index-page, r=ManishearthMazdak Farrokhzad-26/+11
Fix index-page generation Fixes #60096. The minifier was minifying crates name in `searchIndex` key position, which was a bit problematic for multiple reasons. r? @rust-lang/rustdoc
2019-04-26Rollup merge of #59734 - GuillaumeGomez:improve-rustdoc-failure, r=ollie27Mazdak Farrokhzad-3/+4
Prevent failure in case no space left on device in rustdoc Fixes #59703. r? @QuietMisdreavus
2019-04-25ignore-tidy-filelength on all files with greater than 3000 linesvarkor-0/+2
2019-04-25Improvement comment explanationsGuillaume Gomez-2/+5
2019-04-24Remove useless code and update index page testGuillaume Gomez-25/+2
2019-04-24Prevent failure in case no space left on device in rustdocGuillaume Gomez-3/+4
2019-04-23Fix index-page generationGuillaume Gomez-1/+6
2019-04-20Update Source Code Pro fonts to version 2.030Manish Goregaokar-1/+1
Pulled in from https://github.com/adobe-fonts/source-code-pro/
2019-04-20Update Source Serif Pro fonts to version 2.010Manish Goregaokar-1/+1
Pulled in from https://github.com/adobe-fonts/source-serif-pro/ See https://bugzilla.mozilla.org/show_bug.cgi?id=1545317
2019-04-18Fix items alignmentGuillaume Gomez-11/+19
2019-04-18Fixes attributes position in types declGuillaume Gomez-14/+15
2019-04-15use --static-root-path for settings.jsQuietMisdreavus-1/+2
2019-04-14Auto merge of #59950 - Centril:rollup-hpmr62i, r=Centrilbors-8/+19
Rollup of 6 pull requests Successful merges: - #59776 (Apply resource-suffix to search-index and source-files scripts as well) - #59784 (Suggest importing macros from the crate root) - #59812 (Exclude profiler-generated symbols from MSVC __imp_-symbol workaround.) - #59874 (Clean up handling of `-Z pgo-gen` commandline option.) - #59890 (Don't generate empty json variables) - #59911 (Revert "compile crates under test w/ -Zemit-stack-sizes") Failed merges: r? @ghost
2019-04-14Rollup merge of #59890 - GuillaumeGomez:empty-json-variables, r=QuietMisdreavusMazdak Farrokhzad-4/+15
Don't generate empty json variables r? @rust-lang/rustdoc
2019-04-14Rollup merge of #59776 - GuillaumeGomez:apply-resource-suffix, r=QuietMisdreavusMazdak Farrokhzad-4/+4
Apply resource-suffix to search-index and source-files scripts as well Fixes #59771. r? @QuietMisdreavus
2019-04-14Rollup merge of #59855 - GuillaumeGomez:fix-attr-position-in-type-decl, ↵Mazdak Farrokhzad-6/+3
r=QuietMisdreavus Fix attributes position in type declaration Fixes #59797. r? @rust-lang/rustdoc
2019-04-12Apply resource-suffix to search-index and source-files scripts as wellGuillaume Gomez-4/+4
2019-04-12Don't generate empty json variablesGuillaume Gomez-4/+15
2019-04-10Fix attributes position in type declarationGuillaume Gomez-6/+3
2019-04-02Rollup merge of #59452 - GuillaumeGomez:speedup-rustdoc, r=QuietMisdreavusMazdak Farrokhzad-38/+47
Speed up rustdoc run a bit r? @QuietMisdreavus
2019-03-30Remove redundant importFabian Drinck-2/+0
2019-03-30Rollup merge of #59376 - davidtwco:finally-rfc-2008-variants, ↵Mazdak Farrokhzad-1/+14
r=petrochenkov,QuietMisdreavus RFC 2008: Enum Variants Part of #44109. See [Zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rfc-2008/near/132663140) for previous discussion. r? @petrochenkov cc @nikomatsakis
2019-03-29Support non-exhaustive enum variants in rustdoc.David Wood-1/+14
This commit adds support for non-exhaustive enum variants in rustdoc, extending the existing support for non-exhaustive enums and structs.
2019-03-27Speed up rustdoc run a bitGuillaume Gomez-38/+47
2019-03-26Rollup merge of #59004 - GuillaumeGomez:generics-handling, r=QuietMisdreavusGuillaume Gomez-14/+28
[rustdoc] Improve "in parameters" search and search more generally Fixes #58230. r? @QuietMisdreavus
2019-03-25Auto merge of #59256 - petrochenkov:derval2, r=Zoxcbors-7/+7
Make meta-item API compatible with `LocalInternedString::get` soundness fix r? @Zoxc
2019-03-23cleanupGuillaume Gomez-1/+0
2019-03-22Rollup merge of #59170 - varkor:const-generics-rustdoc, r=QuietMisdreavus,eddybMazdak Farrokhzad-5/+5
Add const generics to rustdoc Split out from #53645. This work is a collaborative effort with @yodaldevoid. The `FIXME`s are waiting on a refactor to `LazyConst`. I'll address these in a follow up, but I thought it would be better to implement the rest now to avoid bitrot. r? @QuietMisdreavus
2019-03-21Fix invalid returned types generationGuillaume Gomez-6/+20
2019-03-21Add bounds for return types as wellGuillaume Gomez-15/+12
2019-03-21Improve bounds searchGuillaume Gomez-4/+5
2019-03-21Greatly improve generics handling in rustdoc searchGuillaume Gomez-5/+8