summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2018-12-20semi-revert libsyntax doctest parsing if a macro is wrapping mainQuietMisdreavus-3/+48
2018-12-16backport #56844QuietMisdreavus-1/+1
2018-12-14Fix line numbers displayGuillaume Gomez-2/+2
2018-12-04Auto merge of #55707 - GuillaumeGomez:file-sidebar, r=QuietMisdreavusbors-63/+410
Add source file sidebar This is just a start currently but that gives a good overview of what it'll look like: <img width="1440" alt="screenshot 2018-11-06 at 01 39 15" src="https://user-images.githubusercontent.com/3050060/48035592-05336180-e165-11e8-82e1-5ead0c345eb9.png"> r? @QuietMisdreavus
2018-12-04Auto merge of #55682 - GuillaumeGomez:primitive-sidebar-link-gen, ↵bors-30/+57
r=QuietMisdreavus Fixes primitive sidebar link generation Fixes #50746. Fixes #55656. r? @QuietMisdreavus
2018-12-03Don't generate suffix for source-file.jsGuillaume Gomez-4/+4
2018-12-03Rollup merge of #56438 - yui-knk:remove_not_used_DotEq_token, r=petrochenkovkennytm-1/+1
Remove not used `DotEq` token Currently libproc_macro does not use `DotEq` token. https://github.com/rust-lang/rust/pull/49545 changed libproc_macro to not generate `DotEq` token.
2018-12-03Rollup merge of #56416 - GuillaumeGomez:css-body, r=QuietMisdreavuskennytm-2/+2
Remove unneeded body class selector r? @QuietMisdreavus
2018-12-02Remove not used `DotEq` tokenyui-knk-1/+1
Currently libproc_macro does not use `DotEq` token. https://github.com/rust-lang/rust/pull/49545 changed libproc_macro to not generate `DotEq` token.
2018-12-01Remove unneeded body class selectorGuillaume Gomez-2/+2
2018-11-29Rollup merge of #56321 - jnqnfe:css_nested_list_margin, r=GuillaumeGomezGuillaume Gomez-1/+1
rustdoc: add bottom margin spacing to nested lists the current CSS for nested lists sets margin-bottom to zero, which means that a nested list is squished up against subsequent list items/paragraphs this changes the bottom margin to .6em, same as for paragraphs before: ![before](https://user-images.githubusercontent.com/33935229/49176291-699ba800-f342-11e8-9d33-c4acd4df2beb.png) after: ![after](https://user-images.githubusercontent.com/33935229/49176299-6f918900-f342-11e8-90c3-aa14db195b45.png)
2018-11-28rustdoc: add margin-bottom spacing to nested listsLyndon Brown-1/+1
set to zero meant that the nested list was squished up against subsequent list items/paragraphs this changes the bottom margin to .6em, same as for paragraphs an example demonstrating the difference with screenshots is given in the pull request
2018-11-26rustc-guide has movedMark Mansi-1/+1
2018-11-24Don't show file sidebar by defaultGuillaume Gomez-6/+6
2018-11-24Source sidebar improvementsGuillaume Gomez-60/+86
2018-11-24Add source file sidebarGuillaume Gomez-63/+384
2018-11-24Introduce `TyKind::Placeholder` variantscalexm-0/+1
2018-11-22Rollup merge of #55367 - GuillaumeGomez:private-item-doc-test-lint, ↵Guillaume Gomez-43/+115
r=QuietMisdreavus lint if a private item has doctests Fixes #55333. r? @QuietMisdreavus
2018-11-21Fixes primitive sidebar link generationGuillaume Gomez-30/+57
2018-11-21rustc: remove {FxHash,Node,DefId,HirId,ItemLocal}{Map,Set} "constructor" fns.Eduard-Mihai Burtescu-2/+2
2018-11-19Auto merge of #56051 - pietroalbini:rollup, r=pietroalbinibors-1/+1
Rollup of 25 pull requests Successful merges: - #55562 (Add powerpc- and powerpc64-unknown-linux-musl targets) - #55564 (test/linkage-visibility: Ignore on musl targets) - #55827 (A few tweaks to iterations/collecting) - #55834 (Forward the ABI of the non-zero sized fields of an union if they have the same ABI) - #55857 (remove unused dependency) - #55862 (in which the E0618 "expected function" diagnostic gets a makeover) - #55867 (do not panic just because cargo failed) - #55894 (miri enum discriminant handling: Fix treatment of pointers, better error when it is undef) - #55916 (Make miri value visitor useful for mutation) - #55919 (core/tests/num: Simplify `test_int_from_str_overflow()` test code) - #55923 (reword #[test] attribute error on fn items) - #55949 (ty: return impl Iterator from Predicate::walk_tys) - #55952 (Update to Clang 7 on CI.) - #55953 (#53488 Refactoring UpvarId) - #55962 (rustdoc: properly calculate spans for intra-doc link resolution errors) - #55963 (Stress test for MPSC) - #55968 (Clean up some non-mod-rs stuff.) - #55970 (Miri backtrace improvements) - #56007 (CTFE: dynamically make sure we do not call non-const-fn) - #56011 (Replace data.clone() by Arc::clone(&data) in mutex doc.) - #56012 (avoid shared ref in UnsafeCell::get) - #56016 (Add VecDeque::resize_with) - #56027 (docs: Add missing backtick in object_safety.rs docs) - #56043 (remove "approx env bounds" if we already know from trait) - #56059 (Increase `Duration` approximate equal threshold to 1us)
2018-11-19Rollup merge of #55962 - QuietMisdreavus:tricky-spans, r=GuillaumeGomezPietro Albini-1/+1
rustdoc: properly calculate spans for intra-doc link resolution errors Fixes https://github.com/rust-lang/rust/issues/55723 When rustdoc is reporting a resolution error for intra-doc links, it needs to convert a span from one relative to the *markdown* (as the links are only found on the final markdown text) to one relative to the *source code* (as the error reporting is meant to show where the line is in the source, so the user can fix it). However, a calculation for how much "offset" to apply had a subtle error: it trimmed the whole line when attempting to account for leading indentation. This caused it to add in *trailing* whitespace into this calculation, which created an incorrect span. In a lot of situations, this isn't a problem - the span will be shifted in the code slightly, but the warning will still be displayed and mostly legible. However, there is one important situation where this can cause an ICE: multi-byte codepoints. If a shifted span now has a starting point in the middle of a multi-byte codepoint, libsyntax will panic when trying to track what source item it corresponds to. This flew under our radar because trailing whitespace and multi-byte codepoints are both situations that we don't run into in the compiler repo. (There is one more situation where this can error, that will be much harder to fix: block-style doc comments. Lines in a block-style doc comment have a zero-or-more (usually one) character offset per line, causing this calculation to be way off. I'm punting that to another issue, though...)
2018-11-18resolve: Support resolving macros without leaving tracesVadim Petrochenkov-1/+1
2018-11-16lint if a private item has doctestsGuillaume Gomez-43/+115
2018-11-15Rollup merge of #55926 - cynecx:fix-rustdoc-mobile-css, r=GuillaumeGomezPietro Albini-1/+1
Change sidebar selector to fix compatibility with docs.rs Fix for #55883.
2018-11-15Rollup merge of #55901 - euclio:speling, r=petrochenkovPietro Albini-1/+1
fix various typos in doc comments
2018-11-15Rollup merge of #55778 - nnethercote:LrcPreds, r=eddybPietro Albini-3/+3
Wrap some query results in `Lrc`. So that the frequent clones in `try_get` are cheaper.
2018-11-15Rollup merge of #55750 - oli-obk:node_id_x, r=michaelwoeristerPietro Albini-6/+6
Make `NodeId` and `HirLocalId` `newtype_index`
2018-11-14properly calculate spans for intra-doc link resolution errorsQuietMisdreavus-1/+1
2018-11-14Wrap some query results in `Lrc`.Nicholas Nethercote-3/+3
So that the frequent clones in `try_get` are cheaper. Fixes #54274.
2018-11-13Auto merge of #55912 - kennytm:rollup, r=kennytmbors-37/+76
Rollup of 20 pull requests Successful merges: - #55136 (Remove short doc where it starts with a codeblock) - #55711 (Format BtreeMap::range_mut example) - #55722 (impl_stable_hash_for: support enums and tuple structs with generic parameters) - #55754 (Avoid converting bytes to UTF-8 strings to print, just pass bytes to stdout/err) - #55804 (rustdoc: don't inline `pub use some_crate` unless directly asked to) - #55805 (Move `static_assert!` into librustc_data_structures) - #55837 (Make PhantomData #[structural_match]) - #55840 (Fix TLS errors when downloading stage0) - #55843 (add FromIterator<A> to Box<[A]>) - #55858 (Small fixes on code blocks in rustdoc) - #55863 (Fix a typo in std::panic) - #55870 (Fix typos.) - #55874 (string: Add documentation for `From` impls) - #55879 (save-analysis: Don't panic for macro-generated use globs) - #55882 (Reference count `crate_inherent_impls`s return value.) - #55888 (miri: for uniformity, also move memory_deallocated to AllocationExtra) - #55889 (global allocators: add a few comments) - #55896 (Document optimizations enabled by FusedIterator) - #55905 (Change `Lit::short_name` to `Lit::literal_name`.) - #55908 (Fix their/there grammar nit)
2018-11-13fix various typos in doc commentsAndy Russell-1/+1
2018-11-13Change sidebar selector to fix compatibility with docs.rscynecx-1/+1
2018-11-13Use a dummy outlives requirement for `where Type:,` (see #53696)scalexm-9/+4
A `WF(Type)` predicate was used previously, which did not play well with implied bounds in chalk.
2018-11-13Rollup merge of #55136 - GuillaumeGomez:short-doc, r=QuietMisdreavuskennytm-32/+53
Remove short doc where it starts with a codeblock Fixes #54975.
2018-11-13Rollup merge of #55858 - GuillaumeGomez:fixes-rustdoc-codeblocks, ↵kennytm-4/+9
r=QuietMisdreavus Small fixes on code blocks in rustdoc It currently has a little margin issue with the `i` and there were js errors. r? @QuietMisdreavus
2018-11-13Rollup merge of #55804 - QuietMisdreavus:eager-crate-inline, r=pnkfelixkennytm-1/+14
rustdoc: don't inline `pub use some_crate` unless directly asked to cc https://github.com/rust-lang/rust/issues/52509 (fixes it? i'm not sure about my comment summoning the docs team) When rustdoc encounters a `pub use` statement for an item from another crate, it will eagerly inline its contents into your crate. This somewhat clashes with the new paths behavior in Rust 2018, in which crates are implicitly linked and re-exported with `pub use` instead of `pub extern crate`. In rust 2015, `pub extern crate` would only create a single line for its re-export in the docs, so i'm making it do the same with `pub use some_crate;`. The exact new behavior is like this: *If rustdoc sees a `pub use` statement, and the item being imported is the root of another crate, it will only inline it if `#[doc(inline)]` is provided.* I made it only avoid crate roots because otherwise it would stop inlining any module, which may or may not be what people want.
2018-11-12Use type safe `VariantIdx` instead of `usize` everywhereOliver Scherer-2/+10
2018-11-12Fix rustdocOliver Scherer-6/+6
2018-11-11Rollup merge of #55856 - QuietMisdreavus:static-discharge, r=GuillaumeGomezkennytm-27/+140
rustdoc: refactor: move all static-file include!s into a single module This is a smaller refactor that creates a new module `rustdoc::html::static_files`, which contains a bunch of `static` variables with all the files in `html/static` that we use. The idea behind moving them all here was to remove the duplicate `include_bytes!()` that are used by the theme-checker code. It also continues to centralize more operations in rustdoc.
2018-11-10move all static-file include!s into a single moduleQuietMisdreavus-27/+140
2018-11-10Small fixes on code blocks in rustdocGuillaume Gomez-4/+9
2018-11-10Remove short doc where it starts with a codeblockGuillaume Gomez-32/+53
2018-11-09don't inline `pub use some_crate` unless directly asked toQuietMisdreavus-1/+14
2018-11-08Rollup merge of #55760 - jonhoo:no-intermediate-fonts, r=GuillaumeGomezMark Rousskov-5/+5
Remove intermediate font specs This is a (much) more constrained version of #54772 that also aims at improving the situation in #34681. It removes any font specifications that are not the "official" rustdoc font, and instead relies on the browser to provide the fallback font if the official on is not available. On Linux systems, this is particularly important, as fonts like Helvetica, Arial, and Times often look pretty bad since they're pulled from extracted MS fonts. A specification like `serif` or `sans-serif` lets the browser instead choose a good font.
2018-11-07Remove intermediate font specsJon Gjengset-5/+5
This is a (much) more constrained version of #54772 that also aims at improving the situation in #34681. It removes any font specifications that are not the "official" rustdoc font, and instead relies on the browser to provide the fallback font if the official on is not available. On Linux systems, this is particularly important, as fonts like Helvetica, Arial, and Times often look pretty bad since they're pulled from extracted MS fonts. A specification like `serif` or `sans-serif` lets the browser instead choose a good font.
2018-11-07Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwcokennytm-1/+1
refactor: use shorthand fields refactor: use shorthand for single fields everywhere (excluding tests).
2018-11-06refactor: use shorthand fieldsteresy-1/+1
2018-11-05Auto merge of #55515 - QuietMisdreavus:rustdoc-config, r=GuillaumeGomezbors-552/+727
rustdoc: refactor: centralize all command-line argument parsing This is something i've wanted to do for a while, since we keep having to add new arguments to places like `rust_input` or `core::run_core` whenever we add a new CLI flag or the like. Those functions have inflated up to 11-19, and in some cases hiding away the locations where some CLI flags were being parsed, obscuring their use. Now, we have a central place where all command-line configuration occurs, including argument validation. One note about the design: i grouped together all the arguments that `html::render::run` needed, so that i could pass them on from compilation in one lump instead of trying to thread through individual items or clone the entire blob ahead of time. One other thing this adds is that rustdoc also now recognizes all the `-Z` options that rustc does, since we were manually grabbing a few previously. Now we parse a full `DebuggingOptions` struct and hand it directly to rustc when scraping docs.
2018-11-04fix formattingQuietMisdreavus-3/+3