summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2018-03-03Auto merge of #48410 - QuietMisdreavus:beta-48327, r=alexcrichtonbors-10/+3
[beta] properly run doctests in standalone markdown files with pulldown This is a beta-specific fix for https://github.com/rust-lang/rust/issues/48327, since a different fix landed in nightly (https://github.com/rust-lang/rust/pull/48274) that is infeasible to backport. The nature of the issue was that when running doctests on standalone Markdown files, rustdoc names the tests based on the headings in the files. Therefore, with the following `a.md`: ``````markdown # My Cool Library This is my cool library! ## Examples Here's some cool code samples! ```rust assert_eq!(2+2, 4); ``` `````` Running this file with `rustdoc --test a.md` would show a test named `a.md - my_cool_library::examples (line 9)`. So far, this works just fine between Hoedown and Pulldown. But it gets murkier when you introduce markup into your headings. Consider the following `b.md`: ``````markdown # My Cool Library This is my cool library! ## `libcool` ```rust assert_eq!(2+2, 4); ``` `````` The code surrounding the different renderers handles this differently. Pulldown handles just the first `Text` event after seeing the header, so it names the test `b.md - my_cool_library::libcool (line 9)`. Hoedown, on the other hand, takes all the test within the heading, which Hoedown renders before handing to library code. Therefore, it will name the test `b.md - my_cool_library::_code_libcool__code_ (line 9)`. (Somewhere between rustdoc and libtest, the `</>` characters are replaced with underscores.) This causes a problem with another piece of code: The one that checks for whether Pulldown detected a code block that Hoedown didn't. The test collector groups the "old tests" listing by the full test name, but it *inserts* with the Hoedown name, and *searches* for the Pulldown name! This creates a situation where when `b.md` from above is run, it can't find a matching test from the ones Hoedown extracted, so it discards it and emits a warning. On nightly, this has been fixed by... ditching Hoedown entirely. This also removed the code that tracked the different test listings, and made it run the test anyway. Since backporting the Hoedown removal is infeasible (i'm personally relying on the change to ride the trains to give the stabilization enough time to complete), this instead chooses to group the test by the filename, instead of the full test name as before. This means that the test extractor finds the test properly, and properly runs the test.
2018-02-22Fix rustdoc test ICEGuillaume Gomez-12/+15
2018-02-21[beta] group old_tests by just the filename, not the test nameQuietMisdreavus-10/+3
2018-02-10Rollup merge of #48080 - GuillaumeGomez:mobile-docs-fixes, r=QuietMisdreavuskennytm-32/+7
Hide theme button under menu in mobile mode and fix top margin issue … Fixes #48060. r? @QuietMisdreavus
2018-02-10Rollup merge of #48064 - Manishearth:intra-doc-bail, r=QuietMisdreavuskennytm-0/+4
intra-doc-links: bail early for linky things r? @QuietMisdreavus
2018-02-10Rollup merge of #48051 - ollie27:rustdoc_fn_unit_return, r=QuietMisdreavuskennytm-1/+3
rustdoc: Hide `-> ()` in cross crate inlined Fn* bounds
2018-02-08Hide theme button under menu in mobile mode and fix top margin issue (in ↵Guillaume Gomez-32/+7
mobile too)
2018-02-08Pass themes folder as parameterGuillaume Gomez-6/+6
2018-02-08Add tests for themesGuillaume Gomez-23/+43
2018-02-08Improve output a bit in case of errorGuillaume Gomez-8/+24
2018-02-08Add test when trying to add new themeGuillaume Gomez-5/+16
2018-02-08Handle comments in css selector and add testsGuillaume Gomez-23/+80
2018-02-08Fix missing rules for dark.cssGuillaume Gomez-0/+3
2018-02-08get differencesGuillaume Gomez-10/+43
2018-02-08Add theme testsGuillaume Gomez-0/+285
2018-02-07intra-doc-links: bail early for linky thingsManish Goregaokar-0/+4
2018-02-07Rollup merge of #47810 - GuillaumeGomez:fix-theme-but-position, ↵Manish Goregaokar-4/+55
r=QuietMisdreavus Fix rendering issues on mobile Fixes #47723 r? @QuietMisdreavus
2018-02-07rustdoc: Hide `-> ()` in cross crate inlined Fn* boundsOliver Middleton-1/+3
2018-02-04Rollup merge of #47862 - GuillaumeGomez:const-evaluation-ice, r=eddybkennytm-2/+9
Fix const evaluation ICE in rustdoc Fixes #47860. r? @eddyb
2018-02-04Improve big sidebar elements displayGuillaume Gomez-0/+18
2018-02-04Fix not selectable search inputGuillaume Gomez-0/+5
2018-02-03Fix rendering issues on mobileGuillaume Gomez-4/+32
2018-02-03Fix const evaluation ICE in rustdocGuillaume Gomez-2/+9
2018-02-01Fix ugly hover in sidebarGuillaume Gomez-8/+22
2018-01-31Auto merge of #45752 - estebank:highlight-primary, r=nikomatsakisbors-0/+1
Highlight code on diagnostics when underlined Highlight the label's span with the respective color: <img width="692" alt="" src="https://user-images.githubusercontent.com/1606434/32411026-a1842482-c18d-11e7-9933-6510eefbad19.png"> Fix #42112.
2018-01-30Rollup merge of #47855 - ollie27:rustdoc_hoedown_link_title, r=QuietMisdreavuskennytm-1/+1
rustdoc: Fix link title rendering with hoedown The link title needs to be HTML escaped. It was broken by #47046. r? @QuietMisdreavus
2018-01-29rustdoc: Fix link title rendering with hoedownOliver Middleton-1/+1
The link title needs to be HTML escaped.
2018-01-29Toggle span highlighting on `-Zteach`Esteban Küber-0/+1
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-8/+4
Building on the work of # 45684 this commit updates the compiler to unconditionally load the `rustc_trans` crate at runtime instead of linking to it at compile time. The end goal of this work is to implement # 46819 where rustc will have multiple backends available to it to load. This commit starts off by removing the `extern crate rustc_trans` from the driver. This involved moving some miscellaneous functionality into the `TransCrate` trait and also required an implementation of how to locate and load the trans backend. This ended up being a little tricky because the sysroot isn't always the right location (for example `--sysroot` arguments) so some extra code was added as well to probe a directory relative to the current dll (the rustc_driver dll). Rustbuild has been updated accordingly as well to have a separate compilation invocation for the `rustc_trans` crate and assembly it accordingly into the sysroot. Finally, the distribution logic for the `rustc` package was also updated to slurp up the trans backends folder. A number of assorted fallout changes were included here as well to ensure tests pass and such, and they should all be commented inline.
2018-01-26Merge branch 'rustdoc_masked' of https://github.com/ollie27/rust into rollupAlex Crichton-25/+27
2018-01-25Rollup merge of #47701 - Manishearth:intra-fixes, r=QuietMisdreavusAlex Crichton-41/+138
Fixes for intra-doc-links Turn errors into warnings, also handle methods, trait items, and variants. r? @killercup @QuietMisdreavus
2018-01-25Rollup merge of #47721 - GuillaumeGomez:experimental-color, r=QuietMisdreavusGuillaume Gomez-0/+4
Fix experimental text display on default theme r? @QuietMisdreavus
2018-01-25Auto merge of #47686 - GuillaumeGomez:theme-fixes, r=QuietMisdreavusbors-23/+47
Few fixes for multiple themes support feature r? @QuietMisdreavus Fixes #47695.
2018-01-25Handle variantsManish Goregaokar-4/+17
2018-01-24Fix experimental text display on default themeGuillaume Gomez-0/+4
2018-01-24Make it work for traitsManish Goregaokar-8/+37
2018-01-24Few fixes for multiple themes support featureGuillaume Gomez-23/+47
2018-01-24Handle methodsManish Goregaokar-19/+76
2018-01-24Return Def from resolve()Manish Goregaokar-17/+17
2018-01-24Return Err() if resolve() is called before modules are set upManish Goregaokar-3/+1
2018-01-24Turn error into warningManish Goregaokar-4/+4
2018-01-23Auto merge of #45337 - Zoxc:gen-static, r=nikomatsakisbors-0/+1
Immovable generators This adds support for immovable generators which allow you to borrow local values inside generator across suspension points. These are declared using a `static` keyword: ```rust let mut generator = static || { let local = &Vec::new(); yield; local.push(0i8); }; generator.resume(); // ERROR moving the generator after it has resumed would invalidate the interior reference // drop(generator); ``` Region inference is no longer affected by the types stored in generators so the regions inside should be similar to other code (and unaffected by the presence of `yield` expressions). The borrow checker is extended to pick up the slack so interior references still result in errors for movable generators. This fixes #44197, #45259 and #45093. This PR depends on [PR #44917 (immovable types)](https://github.com/rust-lang/rust/pull/44917), I suggest potential reviewers ignore the first commit as it adds immovable types.
2018-01-23Auto merge of #47678 - kennytm:rollup, r=kennytmbors-4/+20
Rollup of 14 pull requests - Successful merges: #47423, #47425, #47440, #47541, #47549, #47554, #47558, #47610, #47635, #47655, #47661, #47662, #47667, #47672 - Failed merges:
2018-01-23Rollup merge of #47672 - ollie27:rustdoc_auto_traits, r=GuillaumeGomezkennytm-2/+18
rustdoc: Show when traits are auto traits
2018-01-23Auto merge of #47620 - GuillaumeGomez:multiple-themes, r=QuietMisdreavusbors-13/+603
Multiple themes for rustdoc r? @QuietMisdreavus
2018-01-23rustdoc: Hide methods from #[doc(masked)] crates from the search indexOliver Middleton-25/+27
2018-01-23Adds support for immovable generators. Move checking of invalid borrows ↵John Kåre Alsaker-0/+1
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
2018-01-23rustdoc: Show when traits are auto traitsOliver Middleton-2/+18
2018-01-23Fasten even more theme switchGuillaume Gomez-12/+15
2018-01-22don't process code blocks when scanning for linksQuietMisdreavus-2/+1