summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2019-06-26remove unused derives and variantsAndy Russell-7/+0
2019-06-21Better handling of the sender channel part in rustdoc file writingGuillaume Gomez-2/+2
2019-06-21Handle fs errors through errors::Handler instead of eprintln and panicGuillaume Gomez-4/+18
2019-06-21Add DocFS layer to rustdocRobert Collins-136/+152
* Move fs::create_dir_all calls into DocFS to provide a clean extension point if async extension there is needed. * Convert callsites of create_dir_all to ensure_dir to reduce syscalls. * Convert fs::write usage to DocFS.write (which also removes a lot of try_err! usage for easier reading) * Convert File::create calls to use Vec buffers and then DocFS.write in order to consistently reduce syscalls as well, make deferring to threads cleaner and avoid leaving dangling content if writing to existing files.... * Convert OpenOptions usage similarly - I could find no discussion on the use of create_new for that one output file vs all the other files render creates, if link redirection attacks are a concern DocFS will provide a good central point to introduce systematic create_new usage. (fs::write/File::create is vulnerable to link redirection attacks). * DocFS::write defers to rayon for IO on Windows producing a modest speedup: before this patch on my development workstation: $ time cargo +mystg1 doc -p winapi:0.3.7 Documenting winapi v0.3.7 Finished dev [unoptimized + debuginfo] target(s) in 6m 11s real 6m11.734s Afterwards: $ time cargo +mystg1 doc -p winapi:0.3.7 Compiling winapi v0.3.7 Documenting winapi v0.3.7 Finished dev [unoptimized + debuginfo] target(s) in 49.53s real 0m49.643s I haven't measured how much time is in the compilation logic vs in the IO and outputting etc, but this takes it from frustating to tolerable for me, at least for now.
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-16Fix tidyVadim Petrochenkov-16/+21
2019-06-16Separate librustcdoc modulechansuke-209/+207
2019-06-11rustdoc: deny(unused_lifetimes).Eduard-Mihai Burtescu-1/+1
2019-06-08syntax: Move most of the `TokenKind` methods to `Token`Vadim Petrochenkov-1/+1
2019-06-06syntax: Remove duplicate span from `token::Ident`Vadim Petrochenkov-2/+2
2019-06-06syntax: Use `Token` in `StringReader` and `TokenTreesReader`Vadim Petrochenkov-5/+5
2019-06-06syntax: Use `Token` in `TokenTree::Token`Vadim Petrochenkov-2/+2
2019-06-06syntax: Rename `TokenAndSpan` into `Token`Vadim Petrochenkov-15/+15
2019-06-05Addressed points raised in review.Niko Matsakis-4/+19
2019-06-05Aggregation of drive-by cosmetic changes.Alexander Regueiro-4/+3
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-03Auto merge of #59033 - GuillaumeGomez:duplicated-bounds, r=Dylan-DPCbors-11/+11
Fix duplicated bounds printing in rustdoc Fixes #56331. Once again, I couldn't find out how to reproduce it with a small code so no test... :-/ r? @QuietMisdreavus
2019-06-03Auto merge of #61008 - GuillaumeGomez:fix-rustdoc-code-highlighting, ↵bors-3/+14
r=Manishearth Fix lines highlighting in rustdoc source view Fixes #60948. This PR fixes how we handle the lines highlighting from the URL (so in "/doc/src/alloc/string.rs.html#285-283", the "285-283" part). We got a hard limit on 50000, for some unknown and lost reasons which was used in case only one line is selected. r? @Manishearth
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-29upgrade rustdoc's `pulldown-cmark` to 0.5.2Andy Russell-5/+5
Fixes #60482.
2019-05-29Don't generate div inside header (h4/h3/h...) elementsGuillaume Gomez-1/+1
2019-05-26Rename "Associated*" to "Assoc*"Andrew Xu-21/+21
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-23syntax: Turn `token::Lit` into a structVadim Petrochenkov-7/+7
2019-05-22Restore the old behavior of the rustdoc keyword check + Fix rebaseVadim Petrochenkov-8/+8
2019-05-22Simplify use of keyword symbolsVadim Petrochenkov-1/+1
2019-05-21Fix lines highlighting in rustdoc source viewGuillaume Gomez-3/+14
2019-05-20Rollup merge of #60487 - GuillaumeGomez:fix-search-sidebar-width-colors, ↵Mazdak Farrokhzad-9/+10
r=Dylan-DPC Fix search sidebar width when no crate select is present Fixes #60480. I also fixed the box-shadow that seemed to have been kind of removed? r? @QuietMisdreavus
2019-05-20Rollup merge of #60383 - ↵Mazdak Farrokhzad-207/+214
GuillaumeGomez:fix-position-source-code-files-toggle, r=Manishearth Fix position source code files toggle Fixes #60381. The second commit is a big cleanup of the media queries. r? @rust-lang/rustdoc cc @Manishearth screenshot of the fix: <img width="501" alt="Screenshot 2019-04-29 at 23 42 56" src="https://user-images.githubusercontent.com/3050060/56929111-112b2b00-6ad9-11e9-9a23-e0a8e3641395.png">
2019-05-19Auto merge of #60272 - Jakst:patch-1, r=Manishearthbors-5/+24
Explicitly set height on rust logo <img> element in docs The layout of the left side menu in docs reflows when navigating between pages because of missing height on the <img> element of rust logo. Setting height='100' tells the browser to reserve that vertical space, leading to a less janky experience.
2019-05-19Auto merge of #60065 - QuietMisdreavus:async-move-doctests, r=ollie27bors-36/+53
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-19Auto merge of #60760 - GuillaumeGomez:generic-display, r=varkor,badboybors-3/+1
Fix display of const generics in rustdoc <img width="745" alt="Screenshot 2019-05-18 at 15 45 22" src="https://user-images.githubusercontent.com/3050060/57970638-04854e80-7984-11e9-9f04-da6b51ec8bc7.png"> Part of #60737. cc @varkor r? @badboy
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-28/+49
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-18Fix display of const generics in rustdocGuillaume Gomez-3/+1
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-11Keep the original token in `ast::Lit`Vadim Petrochenkov-0/+2
2019-05-07Rollup merge of #60489 - GuillaumeGomez:remove-hamburger, r=QuietMisdreavusMazdak Farrokhzad-0/+4
Remove hamburger button from source code page Fixes #60483. Screenshot: <img width="575" alt="Screenshot 2019-05-03 at 00 12 51" src="https://user-images.githubusercontent.com/3050060/57110298-61ec8f00-6d38-11e9-85fd-d13be94b9c52.png"> cc @rust-lang/rustdoc
2019-05-06update rustdoc doc testQuietMisdreavus-1/+5
2019-05-06update rustdoc unit testsQuietMisdreavus-4/+7
2019-05-06set the default edition when pre-parsing a doctestQuietMisdreavus-31/+41
2019-05-03use span instead of div for since versionAndy Russell-2/+2
2019-05-03Remove hamburger button from source code pageGuillaume Gomez-0/+4
2019-05-02Fix search sidebar width when no crate select is presentGuillaume Gomez-9/+10
2019-04-30Rollup merge of #60382 - Manishearth:revert-code-font, r=GuillaumeGomezMazdak Farrokhzad-3/+3
Revert "Update Source Code Pro fonts to version 2.030" Temporary fix for https://github.com/rust-lang/rust/issues/60365 https://github.com/rust-lang/rust/pull/60146 updated all fonts (not just the fonts that were buggy), however it looks like the new Source Code Pro is buggy. We should test this out of tree: `cargo doc` on anything, replace the font in `target/doc`, and use `python -m SimpleHTTPServer` to see what's going on. Till we figure that out, I'll just back this out. r? @GuillaumeGomez This reverts commit 6bafc58cedc6f409dbcd8919a25b2f5d425f42ae.
2019-04-30Cleanup media queriesGuillaume Gomez-184/+179
2019-04-30Improve file sidebar in source code view page on mobileGuillaume Gomez-33/+45
2019-04-29Revert "Update Source Code Pro fonts to version 2.030"Manish Goregaokar-3/+3
This reverts commit 6bafc58cedc6f409dbcd8919a25b2f5d425f42ae.