summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2019-02-22Fix non-clickable urlsGuillaume Gomez-4/+0
2019-02-22Fix invalid background colorGuillaume Gomez-8/+0
2019-02-17Fixes text becoming invisible when element targettedGuillaume Gomez-14/+2
2019-02-15libpanic_unwind => 2018: fix ICEs.Mazdak Farrokhzad-3/+5
2019-01-15Rollup merge of #57614 - GuillaumeGomez:fix-crate-filtering, r=QuietMisdreavusMazdak Farrokhzad-1/+1
[rustdoc] Fix crates filtering box not being filled Currently, the filter crate box (at the left of the search input) is always empty. To get the number of keys of dictionary in JS, you need to call `Object.keys()` on it. r? @QuietMisdreavus
2019-01-15Fix crates filtering box not being filledGuillaume Gomez-1/+1
2019-01-14Add additional human-readable cfg strings to rustdocJethro Beekman-0/+2
2019-01-13Rollup merge of #56874 - JohnHeitmann:docs-spacing, r=GuillaumeGomezMazdak Farrokhzad-66/+68
Simplify foreign type rendering. Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans. Reduces element count on the `std::iter::Iterator` page by 30%. On my laptop it drops Iterator page load time from ~15s to ~10s. Frame times during scrolling are a hair lower too. Known visual changes (happy to tweak based on feedback): * The main `impl ...` headers are now getting the default, larger, h3 font size. This was an accident, but I liked how it turned out so I didn't fix it. * There's a hair less vertical spacing between the end of a where block and the start of the next fn. Now, all spacing is consistent. I think this looks a bit worse. I may tweak vertical spacing more here or in a follow-up that cleans up vertical spacing more broadly. * "[src]" links are all sized at 17px. A few were 19px in the original. I haven't yet done heavy cross-browser or cross-crate testing. I was hoping to get a quick thumbs up or thumbs down here at this first draft, then if this is on the right track I'll spend some time on that testing. TODO: - [x] Test on Chrome - [x] Test on Firefox - [ ] ~~Test on UC Android~~ - [x] Test on Edge - [x] Test on iOS safari - [x] Test on desktop safari - [x] Update automated tests - [x] Increase vertical margin - [x] Fix "Important traits for" hover overlap - [x] Wait for #55798 to land & merge it
2019-01-13Rollup merge of #57508 - DebugSteven:inline-extern, r=GuillaumeGomezMazdak Farrokhzad-5/+26
rustdoc: Allow inlining of reexported crates and crate items Fixes #46296 This PR checks for when a `pub extern crate` statement has a `#[doc(inline)]` attribute & inlines its contents. Code is based off of the inlining statements for `pub use` statements.
2019-01-12Rollup merge of #57417 - QuietMisdreavus:semi-revert-doctest-parsing, ↵Mazdak Farrokhzad-3/+48
r=GuillaumeGomez rustdoc: use text-based doctest parsing if a macro is wrapping main This is a "forward-port" of https://github.com/rust-lang/rust/pull/57019, intended to get https://github.com/rust-lang/rust/issues/56898 on nightly, since it's now fixed on beta (and already worked on stable). To recap: * The libsyntax-based doctest parsing now checks to see whether there is a top-level macro invocation in the doctest while it's checking for `fn main` and an `extern crate` statement. * If it finds a macro invocation and *didn't* find `fn main`, then it performs the older text-based scan to allow doctests like the ones in `allocator_api` to still compile. A "proper" fix will involve changing how `make_test` works to call it later in the `run_test` function, after the initial steps of compilation have completed. I've filed [a separate issue](https://github.com/rust-lang/rust/issues/57415) for that, though.
2019-01-10inline pub extern crate statementsDebugSteven-5/+26
2019-01-07semi-revert libsyntax doctest parsing if a macro is wrapping mainQuietMisdreavus-3/+48
2019-01-07Update static files code for updated Source Serif Pro fontTrevor Spiteri-19/+12
2019-01-07Replace Heuristica with Source Serif Pro italic in rustdoc.cssTrevor Spiteri-5/+4
2019-01-07Source Serif Pro regular and bold 2.007, and italic 1.007Trevor Spiteri-117/+2
Use fonts from the Roman 2.007 and Italic 1.007 version at: https://github.com/adobe-fonts/source-serif-pro/releases/tag/2.007R-ro%2F1.007R-it The following files are used from the distribution: * WOFF/TTF/SourceSerifPro-Regular.ttf.woff * WOFF/TTF/SourceSerifPro-Bold.ttf.woff * WOFF/TTF/SourceSerifPro-It.ttf.woff These replace the older Source Serif Pro regular and bold fonts, and the Heuristica italic font.
2019-01-05Rollup merge of #57343 - Xanewok:querify-access-levels, r=nikomatsakiskennytm-4/+2
Calculate privacy access only via query Initially converted to query in https://github.com/rust-lang/rust/commit/a9f6babcda1479f4e5566d1aadbf9a0d99aa3182 and then changed to respect dependencies https://github.com/rust-lang/rust/commit/8281e883dd12260f00ce650aa8824507d9c447af. I did this as an effort to prune `CrateAnalysis` from librustc_save_analysis, with the only thing remaining being the glob map (`name` is unused, existing `crate_name` is exposed in the compiler passes, instead). Since calculating the glob map is opt-in, it'd be great if we could calculate that on-demand. However, it seems that it'd require converting resolution to queries, which I'm not sure how to do yet. In an effort to get rid of `CrateAnalysis` altogether, could we try unconditionally calculating the glob_map in the resolver, thus completely removing `CrateAnalysis` struct, and doing a perf run? r? @nikomatsakis cc @petrochenkov do you have any idea how/if at all could we querify the resolver? I've stumbled upon a comment that's ~3? years old at the moment, so I'm guessing things might have changed and it actually may be feasible now. https://github.com/rust-lang/rust/blob/fe0c10019d7ee96909cc42cc265ef999a6b5dd70/src/librustc_driver/driver.rs#L589-L593
2019-01-05Rollup merge of #57338 - QuietMisdreavus:doctest-file-name, r=GuillaumeGomezkennytm-2/+2
rustdoc: force binary filename for compiled doctests Fixes https://github.com/rust-lang/rust/issues/57317, needed for https://github.com/rust-lang/rust-by-example/issues/1137 Right now, when building a doctest, rustdoc provides the compiler an output directory (a temp dir) but lets the compiler name the executable. If the doctest needs to be executed, it then tries to run a binary named `rust_out` from that directory. For the most part, this works fine. However, if the doctest sets its own crate name, the compiler uses that name for the output binary instead. This causes rustdoc to try to execute a nonexistent binary, causing the test to fail. This PR changes the paths rustdoc gives to the compiler when building doctests to force the output *filename* instead of just the *directory*.
2019-01-05Rollup merge of #57314 - wiktorkuchta:master, r=Centrilkennytm-1/+1
Fix repeated word typos Inspired by #57295 (I skipped 'be be' because of it) and my [PR in another repo ](https://github.com/e-maxx-eng/e-maxx-eng/pull/389) Not a stupid `sed`, I actually tried to fix case by case.
2019-01-05Auto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomatsakisbors-4/+15
Add support for trait-objects without a principal The hard-error version of #56481 - should be merged after we do something about the `traitobject` crate. Fixes #33140. Fixes #57057. r? @nikomatsakis
2019-01-04Auto merge of #56897 - euclio:parse-fatal, r=estebankbors-7/+18
make `panictry!` private to libsyntax This commit completely removes usage of the `panictry!` macro from outside libsyntax. The macro causes parse errors to be fatal, so using it in libsyntax_ext caused parse failures *within* a syntax extension to be fatal, which is probably not intended. Furthermore, this commit adds spans to diagnostics emitted by empty extensions if they were missing, à la #56491.
2019-01-04Remove unused name from CrateAnalysisIgor Matuszewski-1/+0
2019-01-04Replace CrateAnalysis::access_levels with queryIgor Matuszewski-3/+2
2019-01-04force binary filename for compiled doctestsQuietMisdreavus-2/+2
2019-01-04hack-fix to rustdocAriel Ben-Yehuda-4/+15
2019-01-03Fix repeated word typosWiktor Kuchta-1/+1
Found with `git grep -P '\b([a-z]+)\s+\1\b'`
2019-01-02make `panictry!` private to libsyntaxAndy Russell-7/+18
This commit completely removes usage of the `panictry!` macro from outside libsyntax. The macro causes parse errors to be fatal, so using it in libsyntax_ext caused parse failures *within* a syntax extension to be fatal, which is probably not intended. Furthermore, this commit adds spans to diagnostics emitted by empty extensions if they were missing, à la #56491.
2019-01-01Move the `Unevaluated` constant arm upwards in the type structureOliver Scherer-12/+11
2018-12-29Auto merge of #56225 - alexreg:type_alias_enum_variants, r=petrochenkovbors-27/+36
Implement RFC 2338, "Type alias enum variants" This PR implements [RFC 2338](https://github.com/rust-lang/rfcs/pull/2338), allowing one to write code like the following. ```rust #![feature(type_alias_enum_variants)] enum Foo { Bar(i32), Baz { i: i32 }, } type Alias = Foo; fn main() { let t = Alias::Bar(0); let t = Alias::Baz { i: 0 }; match t { Alias::Bar(_i) => {} Alias::Baz { i: _i } => {} } } ``` Since `Self` can be considered a type alias in this context, it also enables using `Self::Variant` as both a constructor and pattern. Fixes issues #56199 and #56611. N.B., after discussing the syntax for type arguments on enum variants with @petrochenkov and @eddyb (there are also a few comments on the [tracking issue](https://github.com/rust-lang/rust/issues/49683)), the consensus seems to be treat the syntax as follows, which ought to be backwards-compatible. ```rust Option::<u8>::None; // OK Option::None::<u8>; // OK, but lint in near future (hard error next edition?) Alias::<u8>::None; // OK Alias::None::<u8>; // Error ``` I do not know if this will need an FCP, but let's start one if so.
2018-12-29Rollup merge of #57163 - JohnHeitmann:chevron-fix, r=estebankkennytm-1/+1
Give the crate select chevron room to breathe. Before: ![screen shot 2018-12-27 at 10 26 10 pm](https://user-images.githubusercontent.com/4282480/50505100-9ff24300-0a26-11e9-9b74-37bdee6faf83.png) After: ![screen shot 2018-12-27 at 10 25 57 pm](https://user-images.githubusercontent.com/4282480/50505110-a54f8d80-0a26-11e9-9fa2-7fed21773207.png)
2018-12-29Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavusbors-19/+62
Add no-crate filter option on rustdoc @onur asked me about it so here it is! r? @QuietMisdreavus
2018-12-27Give the crate select chevron room to breathe.John Heitmann-1/+1
2018-12-27Simplify foreign type rendering.John Heitmann-66/+68
Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans. Reduces element count on std::iter::Iterator by 30%.
2018-12-26Store `Ident` rather than just `Name` in HIR types `Item` and `ForeignItem`.Alexander Regueiro-27/+36
2018-12-25Remove licensesMark Rousskov-479/+1
2018-12-25Auto merge of #56962 - nivkner:fixme_fixup4, r=pnkfelixbors-8/+7
address some FIXME whose associated issues were marked as closed part of #44366
2018-12-24Add no-crate filter option on rustdocGuillaume Gomez-19/+62
2018-12-23Rollup merge of #57011 - QuietMisdreavus:static-root-path, r=GuillaumeGomezkennytm-22/+68
rustdoc: add new CLI flag to load static files from a different location This PR adds a new CLI flag to rustdoc, `--static-root-path`, which controls how rustdoc links pages to the CSS/JS/font static files bundled with the output. By default, these files are linked with a series of `../` which is calculated per-page to link it to the documentation root - i.e. a relative link to the directory given by `-o`. This is causing problems for docs.rs, because even though docs.rs has saved one copy of these files and is dispatching them dynamically, browsers have no way of knowing that these are the same files and can cache them. This can allow it to link these files as, for example, `/rustdoc.css` instead of `../../rustdoc.css`, creating a single location that the files are loaded from. I made sure to only change links for the *static* files, those that don't change between crates. Files like the search index, aliases, the source files listing, etc, are still linked with relative links. r? @GuillaumeGomez cc @onur
2018-12-23Rollup merge of #56967 - GuillaumeGomez:regen-search-index, r=QuietMisdreavuskennytm-2/+2
Replace current crate's searchIndex when regenerating Fixes #56921. r? @QuietMisdreavus
2018-12-22Auto merge of #56824 - euclio:internal-apis, r=QuietMisdreavusbors-117/+143
rustdoc: display rustc_private APIs as "Internal" This PR updates the display of `rustc_private` APIs to be "Internal" instead of "Experimental", and changes the colors appropriately. It also updates the copy of the `rustc_private` feature to sound more informative and less like a compiler suggestion. The PR additionally contains a significant refactor of the `short_stability` function to remove duplication and fix a few rendering bugs due to extra or missing spaces. Before: ![screen shot 2018-12-14 at 11 45 28 am](https://user-images.githubusercontent.com/1372438/50015926-c9768d80-ff95-11e8-9649-5df29df6909b.png) After: ![screen shot 2018-12-14 at 11 45 11 am](https://user-images.githubusercontent.com/1372438/50015934-cf6c6e80-ff95-11e8-912b-74b893f55425.png)
2018-12-21Auto merge of #55798 - GuillaumeGomez:version-display-associated-const, ↵bors-31/+51
r=QuietMisdreavus Add version display for associated consts Fixes #54030. <img width="1440" alt="screenshot 2018-11-08 at 23 57 29" src="https://user-images.githubusercontent.com/3050060/48232648-99decf00-e3b2-11e8-9f41-6bd12a161c7d.png"> r? @QuietMisdreavus
2018-12-20Auto merge of #56845 - GuillaumeGomez:const-docs, r=oli-obkbors-4/+10
Don't render const keyword on stable Fixes #55246. Continuation of #55327. r? @oli-obk
2018-12-20display rustc_private APIs as "Internal"Andy Russell-8/+42
2018-12-20split extra_scripts to handle root_path shenanigansQuietMisdreavus-10/+23
2018-12-20new --static-root-path flag for controlling static file locationsQuietMisdreavus-14/+47
2018-12-19FIXME(9639) remove fixme and accept non-utf8 paths in librustdocNiv Kaminer-7/+5
2018-12-19Auto merge of #56601 - Zoxc:lifetime-killer, r=nikomatsakisbors-2/+2
Make the 'a lifetime on TyCtxt useless cc @rust-lang/compiler r? @nikomatsakis
2018-12-19Rollup merge of #56959 - JohnHeitmann:mobile-z-fix, r=GuillaumeGomezPietro Albini-1/+1
Fix mobile menu rendering collision with tooltip. Bring the mobile-mode menu in front of the ⓘ icon. Here's what the bug looks like: ![screen shot 2018-12-18 at 1 53 46 pm](https://user-images.githubusercontent.com/4282480/50185501-cbf62180-02cc-11e9-927e-3c6469901323.png)
2018-12-19Rollup merge of #56663 - Zoxc:resolver-lifetime, r=pnkfelixPietro Albini-39/+39
Remove lifetime from Resolver
2018-12-19Set constness correctlyGuillaume Gomez-2/+8
2018-12-19FIXME(RFC1868) point the fixme to the tracking issueNiv Kaminer-1/+2