summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2017-12-29Auto merge of #46883 - QuietMisdreavus:faildown, r=GuillaumeGomezbors-1/+7
rustdoc: add option to abort the process on markdown differences In the efforts of keeping the std docs free of markdown warnings, this PR adds a stopgap measure to make sure the CI fails if it detects a markdown difference. It does this by adding a new unstable flag to rustdoc, `--deny-render-differences`, which bootstrap then passes to rustdoc when documenting std and friends. The implementation is... probably not the cleanest option. It currently adds an extra branch after it prints the markdown warnings, which just prints a final line and calls `::std::process::abort(1)`. I did it like this because if it just panics regularly, it looks like an ICE, an even though `html::render::run` returns a Result, that Result is also just `expect`ed immediately, generating the same problem. This way bypasses the panic handler at the top of the thread and looks like a proper failure. Since i don't have a real error Handler there, this is the best i can do without pulling in a real error system for rustdoc. This PR is blocked on https://github.com/rust-lang/rust/pull/46853, which will fix the rendering differences that were present on master when i started this branch.
2017-12-27rustdoc: add option to abort process on markdown differencesQuietMisdreavus-1/+7
2017-12-21Auto merge of #46922 - kennytm:rollup, r=kennytmbors-3/+4
Rollup of 14 pull requests - Successful merges: #46636, #46780, #46784, #46809, #46814, #46820, #46839, #46847, #46858, #46878, #46884, #46890, #46898, #46918 - Failed merges:
2017-12-22Rollup merge of #46847 - GuillaumeGomez:more-sidebar-escape, r=QuietMisdreavuskennytm-3/+4
Escape more items in the sidebar when needed Fixes #46724. r? @QuietMisdreavus
2017-12-21Add GenericParam, refactor Generics in ast, hir, rustdocJonas Platte-2/+4
The Generics now contain one Vec of an enum for the generic parameters, rather than two separate Vec's for lifetime and type parameters. Additionally, places that previously used Vec<LifetimeDef> now use Vec<GenericParam> instead.
2017-12-21Escape more items in the sidebar when neededGuillaume Gomez-3/+4
2017-12-17Add an option to allow rustdoc to list modules by appearancevarkor-4/+13
The `--sort-modules-by-appearance` option will list modules in the order that they appear in the source, rather than sorting them alphabetically (as is the default). This resolves #8552.
2017-12-14Use PathBuf instead of String where applicableOliver Schneider-27/+34
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-5/+2
2017-12-08Auto merge of #46247 - GuillaumeGomez:md-warnings, r=QuietMisdreqvusbors-8/+16
Md warnings Fixes #45365. r? @QuietMisdreavus
2017-12-07fix markdown file differencesGuillaume Gomez-6/+11
2017-12-07Generate difference warnings for markdown files as wellGuillaume Gomez-2/+5
2017-12-07Greatly improve sidebar when width < 700pxGuillaume Gomez-0/+7
2017-12-03Auto merge of #46384 - ollie27:rustdoc_inline_assoc, r=QuietMisdreavusbors-1/+2
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-5/+6
Fix invalid HTML escape Fixes #46289. r? @QuietMisdreavus
2017-12-02Auto merge of #46288 - alexcrichton:bump-bootstrap, r=Mark-Simulacrumbors-2/+0
Bump to 1.24.0 * Update the in-tree version number * Update the bootstrap compiler * Remove `cfg(stage0)` annotations * Update crate dependencies * Update Cargo itself
2017-11-29Update bootstrap compilerAlex Crichton-2/+0
Also remove a number of `stage0` annotations and such
2017-11-30Fix rustoc item summaries that are headersChristian Duerr-1/+3
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-1/+2
* 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-5/+6
2017-11-22Auto merge of #44781 - QuietMisdreavus:doc-include, r=GuillaumeGomezbors-4/+26
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-4/+26
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-9/+19
Display negative traits implementation Fixes #45816. r? @QuietMisdreavus
2017-11-21Auto merge of #45039 - QuietMisdreavus:doc-spotlight, ↵bors-7/+74
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-9/+19
2017-11-20Make rustdoc not include self-by-value methods from Deref targetFlorian Hartwig-5/+6
2017-11-18Add tooltip for important traits displayGuillaume Gomez-4/+9
2017-11-18Auto merge of #46000 - kennytm:fix-45640-extern-type-ice-in-rustdoc, ↵bors-2/+29
r=QuietMisdreavus Support `extern type` in rustdoc. Fixes #45640. (cc #43467)
2017-11-17Add trait methods as wellGuillaume Gomez-1/+2
2017-11-17Improve modal display and add JS eventsGuillaume Gomez-11/+6
2017-11-17First step for important traits UIGuillaume Gomez-13/+14
2017-11-17spotlight Iterator/Read/Write impls on function return typesQuietMisdreavus-7/+72
2017-11-15Escape doc root URLsLaurentiu Nicola-1/+1
2017-11-15Support `extern type` in rustdoc.kennytm-2/+29
Fixes #45640.
2017-11-12Generate generics on search-indexGuillaume Gomez-7/+29
2017-11-07Add more elements in the sidebarGuillaume Gomez-31/+139
2017-11-07Auto merge of #45620 - ollie27:rustdoc_impl_generic_dupe, r=QuietMisdreavusbors-4/+4
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-05Auto merge of #44042 - LukasKalbertodt:ascii-methods-on-instrinsics, ↵bors-0/+1
r=alexcrichton Copy all `AsciiExt` methods to the primitive types directly in order to deprecate it later **EDIT:** [this PR is ready now](https://github.com/rust-lang/rust/pull/44042#issuecomment-333883548). I edited this post to reflect the current status of discussion, which is (apart from code review) pretty much settled. --- This is my current progress in order to prepare stabilization of #39658. As discussed there (and in #39659), the idea is to deprecated `AsciiExt` and copy all methods to the type directly. Apparently there isn't really a reason to have those methods in an extension trait¹. ~~This is **work in progress**: copy&pasting code while slightly modifying the documentation isn't the most exciting thing to do. Therefore I wanted to already open this WIP PR after doing basically 1/4 of the job (copying methods to `&[u8]`, `char` and `&str` is still missing) to get some feedback before I continue. Some questions possibly worth discussing:~~ 1. ~~Does everyone agree that deprecating `AsciiExt` is a good idea? Does everyone agree with the goal of this PR?~~ => apparently yes 2. ~~Are my changes OK so far? Did I do something wrong?~~ 3. ~~The issue of the unstable-attribute is currently set to 0. I would wait until you say "Ok" to the whole thing, then create a tracking issue and then insert the correct issue id. Is that ok?~~ 4. ~~I tweaked `eq_ignore_ascii_case()`: it now takes the argument `other: u8` instead of `other: &u8`. The latter was enforced by the trait. Since we're not bound to a trait anymore, we can drop the reference, ok?~~ => I reverted this, because the interface has to match the `AsciiExt` interface exactly. ¹ ~~Could it be that we can't write `impl [u8] {}`? This might be the reason for `AsciiExt`. If that is the case: is there a good reason we can't write such an impl block? What can we do instead?~~ => we couldn't at the time this PR was opened, but Simon made it possible. /cc @SimonSapin @zackw
2017-11-03Remove unused AsciiExt imports and fix tests related to ascii methodsLukas Kalbertodt-0/+1
Many AsciiExt imports have become useless thanks to the inherent ascii methods added in the last commits. These were removed. In some places, I fully specified the ascii method being called to enforce usage of the AsciiExt trait. Note that some imports are not removed but tagged with a `#[cfg(stage0)]` attribute. This is necessary, because certain ascii methods are not yet available in stage0. All those imports will be removed later. Additionally, failing tests were fixed. The test suite should exit successfully now.
2017-11-03[Syntax Breaking] Rename DefaultImpl to AutoImplleonardo.yvens-2/+2
DefaultImpl is a highly confusing name for what we now call auto impls, as in `impl Send for ..`. The name auto impl is not formally decided but for sanity anything is better than `DefaultImpl` which refers neither to `default impl` nor to `impl Default`.
2017-11-01Auto merge of #45187 - GuillaumeGomez:doc-ui-improvement, r=QuietMisdreavusbors-42/+104
Improve sidebar rendering and add methods list I suppose it can be reviewed as is, but this is just the first step of a more global plan. cc @rust-lang/docs @nical And a screenshot of course: <img width="1440" alt="screen shot 2017-10-10 at 23 38 45" src="https://user-images.githubusercontent.com/3050060/31412170-657beaf6-ae14-11e7-9f01-1e562a034595.png">
2017-10-29rustdoc: Fix duplicated impls with genericsOliver Middleton-4/+4
The same type can appear multiple times in impls so we need to use a set to avoid adding it multiple times.
2017-10-28Fix weird bugsGuillaume Gomez-31/+43
2017-10-27Encode urlsGuillaume Gomez-1/+17
2017-10-27Change sidebar items orderGuillaume Gomez-3/+3
2017-10-27Improve sidebar rendering and add methods listGuillaume Gomez-14/+48
2017-10-27Implement RFC 1861: Extern typesPaul Lietar-1/+3
2017-10-16Display rustdoc pulldown switch warnings everytimeGuillaume Gomez-27/+22
2017-10-15Auto merge of #44613 - QuietMisdreavus:rustdoc-perf, r=michaelwoeristerbors-5/+22
some low-hanging rustdoc optimizations There were a few discussions earlier today in #rust-internals about the syscall usage and overall performance of rustdoc. This PR is intended to pick some low-hanging fruit and try to rein in some of the performance issues of rustdoc.
2017-10-13rustdoc: wrap redirect page writers in a BufWriterQuietMisdreavus-2/+4