summary refs log tree commit diff
path: root/src/librustdoc/lib.rs
AgeCommit message (Collapse)AuthorLines
2019-02-23Transition librustdoc to 2018 editionHirokazu Hata-5/+2
2019-02-17Rollup merge of #57929 - GuillaumeGomez:rustodc-remove-old-style-files, ↵kennytm-0/+5
r=ollie27 Rustdoc remove old style files Reopening of #56577 (which I can't seem to reopen...). I made the flag unstable so with this change, what was blocking the PR is now gone I assume.
2019-02-12Stabilize slice_sort_by_cached_keyScott McMurray-1/+0
2019-02-07Remove images' url to make it work even without internet connectionGuillaume Gomez-3/+1
2019-01-27Make 'generate-redirect-pages' option unstableGuillaume Gomez-1/+1
2019-01-27Add generate-old-style-files option to rustdocGuillaume Gomez-0/+5
2019-01-20Auto merge of #56884 - euclio:codeblock-diagnostics, r=QuietMisdreavusbors-0/+1
rustdoc: overhaul code block lexing errors Fixes #53919. This PR moves the reporting of code block lexing errors from rendering time to an early pass, so we can use the compiler's error reporting mechanisms. This dramatically improves the diagnostics in this situation: we now de-emphasize the lexing errors as a note under a warning that has a span and suggestion instead of just emitting errors at the top level. Additionally, this PR generalizes the markdown -> source span calculation function, which should allow other rustdoc warnings to use better spans in the future. Last, the PR makes sure that the code block is always emitted in the docs, even if it fails to highlight correctly. Of note: - The new pass unfortunately adds another pass over the docs to gather the doc blocks for syntax-checking. I wonder if this could be combined with the pass that looks for testable blocks? I'm not familiar with that code, so I don't know how feasible that is. - `pulldown_cmark` doesn't make it easy to find the spans of the code blocks, so the code that calculates the spans is a little nasty. It works for all the test cases I threw at it, but I wouldn't be surprised if an edge case would break it. Should have a thorough review. - This PR worsens the state of #56885, since those certain fatal lexing errors are now emitted before docs get generated at all.
2019-01-17Add book section and fix typo.Wesley Norris-0/+1
2019-01-17Minor changes to wording and formatting.Wesley Norris-1/+1
2019-01-17Persist doc test executables to given path.Wesley Norris-0/+5
2019-01-14rustdoc: check code block syntax in early passAndy Russell-0/+1
2019-01-02make `panictry!` private to libsyntaxAndy Russell-1/+1
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.
2018-12-29Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavusbors-0/+5
Add no-crate filter option on rustdoc @onur asked me about it so here it is! r? @QuietMisdreavus
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-24Add no-crate filter option on rustdocGuillaume Gomez-0/+5
2018-12-20new --static-root-path flag for controlling static file locationsQuietMisdreavus-0/+8
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-1/+1
2018-12-05emit error when doc generation failsAndy Russell-3/+15
Fixes #41813.
2018-11-10move all static-file include!s into a single moduleQuietMisdreavus-0/+1
2018-11-02pass the Options struct instead of individual argsQuietMisdreavus-53/+9
2018-11-02split off a separate RenderOptions structQuietMisdreavus-25/+33
2018-11-02swap uses of Matches with pre-parsed argsQuietMisdreavus-97/+31
2018-11-02parse command-line into a central Options structQuietMisdreavus-298/+38
2018-11-02Auto merge of #54543 - GuillaumeGomez:top-level-index, r=QuietMisdreavusbors-14/+37
Add index page argument @Mark-Simulacrum: I might need some help from you: in bootstrap, I want to add an argument (a new flag added into `rustdoc`) in order to generate the current index directly when `rustdoc` is documenting the `std` lib. However, my change in `bootstrap` didn't do it and I assume it must be moved inside the `Std` struct. But there, I don't see how to pass it to `rustdoc` through `cargo`. Did I miss anything? r? @QuietMisdreavus
2018-10-26Remove redundant cloneShotaro Yamada-1/+1
2018-10-21Use markdown::render instead of using pulldown_cmark directlyGuillaume Gomez-13/+14
2018-10-21Add index pageGuillaume Gomez-1/+23
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-22Rollup merge of #54371 - QuietMisdreavus:rustdoc-ui-testing, r=GuillaumeGomezPietro Albini-3/+9
add -Zui-testing to rustdoc Before we depend on the `rustdoc-ui` tests some more, let's make rustdoc act the same as the compiler when they're actually being executed.
2018-09-20shuffle ownership of `external_traits`QuietMisdreavus-0/+1
constraints: - clean/inline.rs needs this map to fill in traits when inlining - fold.rs needs this map to allow passes to fold trait items - html/render.rs needs this map to seed the Cache.traits map of all known traits The first two are the real problem, since `DocFolder` only operates on `clean::Crate` but `clean/inline.rs` only sees the `DocContext`. The introduction of early passes means that these two now exist at the same time, so they need to share ownership of the map. Even better, the use of `Crate` in a rustc thread pool means that it needs to be Sync, so it can't use `Lrc<Lock>` to manually activate thread-safety. `parking_lot` is reused from elsewhere in the tree to allow use of its `ReentrantMutex`, as the relevant parts of rustdoc are still single-threaded and this allows for easier use in that context.
2018-09-20don't index trait impls if the trait isn't also documentedQuietMisdreavus-0/+1
2018-09-19add -Zui-testing to rustdocQuietMisdreavus-3/+9
2018-09-18Rollup merge of #54205 - GuillaumeGomez:treat-err-as-bug, r=QuietMisdreavusGuillaume Gomez-3/+10
Add treat-err-as-bug flag in rustdoc cc @nikomatsakis r? @QuietMisdreavus
2018-09-15rustc: add unstable support for --extern crate_name without a path.Eduard-Mihai Burtescu-4/+7
2018-09-13Add treat-err-as-bug flag in rustdocGuillaume Gomez-3/+10
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-09-09Stabilize the 2018 editionMark Rousskov-1/+1
2018-09-01Rollup merge of #53076 - QuietMisdreavus:cfg-rustdoc, r=GuillaumeGomezkennytm-2/+4
set cfg(rustdoc) when rustdoc is running on a crate When using `#[doc(cfg)]` to document platform-specific items, it's a little cumbersome to get all the platforms' items to appear all at once. For example, the standard library adds `--cfg dox` to rustdoc's command line whenever it builds docs, and the documentation for `#![feature(doc_cfg)]` suggests using a Cargo feature to approximate the same thing. This is a little awkward, because you always need to remember to set `--features dox` whenever you build documentation. This PR proposes making rustdoc set `#[cfg(rustdoc)]` whenever it runs on a crate, to provide an officially-sanctioned version of this that is set automatically. This way, there's a standardized way to declare that a certain version of an item is specifically when building docs. To try to prevent the spread of this feature from happening too quickly, this PR also restricts the use of this flag to whenever `#![feature(doc_cfg)]` is active. I'm sure there are other uses for this, but right now i'm tying it to this feature. (If it makes more sense to give this its own feature, i can easily do that.)
2018-08-31feature(doc_cfg): set cfg(rustdoc) when rustdoc is runningQuietMisdreavus-2/+4
2018-08-31Auto merge of #51384 - QuietMisdreavus:extern-version, r=GuillaumeGomezbors-1/+29
rustdoc: add flag to control the html_root_url of dependencies The `--extern-html-root-url` flag in this PR allows one to override links to crates whose docs are not already available locally in the doc bundle. Docs.rs currently uses a version of this to make sure links to other crates go into that crate's docs.rs page. See the included test for intended use, but the idea is as follows: Calling rustdoc with `--extern-html-root-url crate=https://some-url.com` will cause rustdoc to override links that point to that crate to instead be replaced with a link rooted at `https://some-url.com/`. (e.g. for docs.rs this would be `https://docs.rs/crate/0.1.0` or the like.) Cheekily, rustup could use these options to redirect links to std/core/etc to instead point to locally-downloaded docs, if it so desired. Fixes https://github.com/rust-lang/rust/issues/19603
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-25Auto merge of #53385 - matklad:stabilize-find-map, r=KodrAusbors-1/+0
Stablize Iterator::find_map Stabilization PR for https://github.com/rust-lang/rust/issues/49602
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-2/+2
2018-08-15Stablize Iterator::find_mapAleksey Kladov-1/+0
2018-08-09[nll] librustdoc: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-06Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboatsbors-3/+0
Add errors for unknown, stable and duplicate feature attributes - Adds an error for unknown (lang and lib) features. - Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features). - Adds an error for duplicate (lang and lib) features. ```rust #![feature(fake_feature)] //~ ERROR unknown feature `fake_feature` #![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0 #![feature(non_exhaustive)] #![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute ``` Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features). There are a few outstanding problems, that I haven't narrowed down yet: - [x] Stability attributes on macros do not seem to be taken into account. - [x] Stability attributes behind `cfg` attributes are not taken into account. - [x] There are failing incremental tests.
2018-08-05Remove bad features after rebasevarkor-1/+0
2018-08-05Remove unnecessary feature attributes that sneaked invarkor-2/+0
2018-08-04introduce "early passes" an convert a few overQuietMisdreavus-60/+6