summary refs log tree commit diff
path: root/src/librustdoc/lib.rs
AgeCommit message (Collapse)AuthorLines
2018-04-01Rollup merge of #49451 - QuietMisdreavus:epoch-doctests, r=GuillaumeGomezMark Simulacrum-8/+30
rustdoc: add an --edition flag to compile docs/doctests with a certain edition To correspond with the 2018 edition, this adds a (currently unstable) `--edition` flag to rustdoc that makes it compile crates and doctests with the given edition. Once this lands, Cargo should be updated to pass this flag when the edition configuration option is given.
2018-03-30Rollup merge of #49445 - GuillaumeGomez:light-theme, r=QuietMisdreavuskennytm-4/+4
Rename main theme into light theme r? @QuietMisdreavus
2018-03-29Rename main theme into light themeGuillaume Gomez-4/+4
2018-03-29tidyQuietMisdreavus-2/+8
2018-03-28use --edition for doctests, rather than just the crateQuietMisdreavus-1/+1
2018-03-27add --edition flag to rustdocQuietMisdreavus-6/+22
2018-03-26Introduce a TargetTriple enum to support absolute target pathsPhilipp Oppermann-1/+8
2018-03-20Stabilize slice patterns without `..`Vadim Petrochenkov-1/+1
Merge `feature(advanced_slice_patterns)` into `feature(slice_patterns)`
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-3/+6
2018-03-06Rollup merge of #48511 - GuillaumeGomez:rustdoc-resource-suffix, ↵Alex Crichton-0/+9
r=QuietMisdreavus Add resource-suffix option for rustdoc Alternative version of #48442. cc @onur r? @QuietMisdreavus
2018-03-06Update env_logger to 0.5.4Alex Crichton-1/+1
It looks like this cuts down on the number of dependencies in env_logger and notably cuts out a difference between a shared dependency of rls/cargo. My goal here is to ensure that when we compile the RLS/Cargo on CI we only compile Cargo once, and this is one step towards that!
2018-03-05Add resource-suffix option for rustdocGuillaume Gomez-0/+9
2018-02-18Generate documentation for auto-trait implsAaron Hill-1/+3
A new section is added to both both struct and trait doc pages. On struct/enum pages, a new 'Auto Trait Implementations' section displays any synthetic implementations for auto traits. Currently, this is only done for Send and Sync. On trait pages, a new 'Auto Implementors' section displays all types which automatically implement the trait. Effectively, this is a list of all public types in the standard library. Synthesized impls for a particular auto trait ('synthetic impls') take into account generic bounds. For example, a type 'struct Foo<T>(T)' will have 'impl<T> Send for Foo<T> where T: Send' generated for it. Manual implementations of auto traits are also taken into account. If we have the following types: 'struct Foo<T>(T)' 'struct Wrapper<T>(Foo<T>)' 'unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes this sound somehow Then Wrapper will have the following impl generated: 'impl<T> Send for Wrapper<T>' reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send' to hold Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are taken into account by synthetic impls However, if a type can *never* implement a particular auto trait (e.g. 'struct MyStruct<T>(*const T)'), then a negative impl will be generated (in this case, 'impl<T> !Send for MyStruct<T>') All of this means that a user should be able to copy-paste a synthetic impl into their code, without any observable changes in behavior (assuming the rest of the program remains unchanged).
2018-02-16Remove hoedown from rustdocGuillaume Gomez-35/+6
Is it really time? Have our months, no, *years* of suffering come to an end? Are we finally able to cast off the pall of Hoedown? The weight which has dragged us down for so long? ----- So, timeline for those who need to catch up: * Way back in December 2016, [we decided we wanted to switch out the markdown renderer](https://github.com/rust-lang/rust/issues/38400). However, this was put on hold because the build system at the time made it difficult to pull in dependencies from crates.io. * A few months later, in March 2017, [the first PR was done, to switch out the renderers entirely](https://github.com/rust-lang/rust/pull/40338). The PR itself was fraught with CI and build system issues, but eventually landed. * However, not all was well in the Rustdoc world. During the PR and shortly after, we noticed [some differences in the way the two parsers handled some things](https://github.com/rust-lang/rust/issues/40912), and some of these differences were major enough to break the docs for some crates. * A couple weeks afterward, [Hoedown was put back in](https://github.com/rust-lang/rust/pull/41290), at this point just to catch tests that Pulldown was "spuriously" running. This would at least provide some warning about spurious tests, rather than just breaking spontaneously. * However, the problems had created enough noise by this point that just a few days after that, [Hoedown was switched back to the default](https://github.com/rust-lang/rust/pull/41431) while we came up with a solution for properly warning about the differences. * That solution came a few weeks later, [as a series of warnings when the HTML emitted by the two parsers was semantically different](https://github.com/rust-lang/rust/pull/41991). But that came at a cost, as now rustdoc needed proc-macro support (the new crate needed some custom derives farther down its dependency tree), and the build system was not equipped to handle it at the time. It was worked on for three months as the issue stumped more and more people. * In that time, [bootstrap was completely reworked](https://github.com/rust-lang/rust/pull/43059) to change how it ordered compilation, and [the method by which it built rustdoc would change](https://github.com/rust-lang/rust/pull/43482), as well. This allowed it to only be built after stage1, when proc-macros would be available, allowing the "rendering differences" PR to finally land. * The warnings were not perfect, and revealed a few [spurious](https://github.com/rust-lang/rust/pull/44368) [differences](https://github.com/rust-lang/rust/pull/45421) between how we handled the renderers. * Once these were handled, [we flipped the switch to turn on the "rendering difference" warnings all the time](https://github.com/rust-lang/rust/pull/45324), in October 2017. This began the "warning cycle" for this change, and landed in stable in 1.23, on 2018-01-04. * Once those warnings hit stable, and after a couple weeks of seeing whether we would get any more reports than what we got from sitting on nightly/beta, [we switched the renderers](https://github.com/rust-lang/rust/pull/47398), making Pulldown the default but still offering the option to use Hoedown. And that brings us to the present. We haven't received more new issues from this in the meantime, and the "switch by default" is now on beta. Our reasoning is that, at this point, anyone who would have been affected by this has run into it already.
2018-02-08Pass themes folder as parameterGuillaume Gomez-5/+5
2018-02-08Add tests for themesGuillaume Gomez-4/+4
2018-02-08Improve output a bit in case of errorGuillaume Gomez-4/+7
2018-02-08Add test when trying to add new themeGuillaume Gomez-5/+16
2018-02-08get differencesGuillaume Gomez-1/+3
2018-02-08Add theme testsGuillaume Gomez-0/+27
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-2/+0
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-23Auto merge of #47620 - GuillaumeGomez:multiple-themes, r=QuietMisdreavusbors-1/+16
Multiple themes for rustdoc r? @QuietMisdreavus
2018-01-22Update to new commonmark argManish Goregaokar-3/+3
2018-01-22cleanupQuietMisdreavus-1/+1
2018-01-22Make correct resolver available in rustdocManish Goregaokar-1/+1
2018-01-22add RenderType to DocContextQuietMisdreavus-1/+6
2018-01-21Add themes optionGuillaume Gomez-1/+16
2018-01-19Allow runtime switching between trans backendsbjorn3-1/+3
2018-01-17Rollup merge of #47398 - GuillaumeGomez:pulldown-warnings, r=QuietMisdreavusGuillaume Gomez-5/+5
Switch to pulldown as default markdown renderer r? @QuietMisdreavus
2018-01-12Switch to pulldown as default markdown rendererGuillaume Gomez-5/+5
2018-01-10Use the new fs_read_write functions in rustc internalsMatt Brubeck-0/+1
2017-12-27rustdoc: add option to abort process on markdown differencesQuietMisdreavus-1/+7
2017-12-18Fix tidy issuevarkor-1/+2
2017-12-17Add an option to allow rustdoc to list modules by appearancevarkor-1/+6
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-13/+13
2017-12-04rustc_back: replace tempdir with crates.io version.Irina-Gabriela Popa-0/+1
2017-11-30Show hidden items with rustdoc's document-privateChristian Duerr-1/+0
When using `#[doc(hidden)]` elements are hidden from docs even when the rustdoc flag `--document-private-items` is set. This behavior has been changed to display all hidden items when the flag is active.
2017-11-03Mark several ascii methods as unstable againLukas Kalbertodt-0/+1
We don't want to stabilize them now already. The goal of this set of commits is just to add inherent methods to the four types. Stabilizing all of those methods can be done later.
2017-11-03Copy `AsciiExt` methods to `char` directlyLukas Kalbertodt-1/+0
This is done in order to deprecate AsciiExt eventually.
2017-10-17Create a new flag, --document-private-itemssteveklabnik-0/+19
Fixes #44136
2017-10-17Deprecate several flags in rustdocsteveklabnik-0/+22
Part of #44136 Upgrades cargo due to https://github.com/rust-lang/cargo/pull/4451
2017-10-15rustbuild: Support specifying archiver and linker explicitlyVadim Petrochenkov-2/+6
2017-10-09let rustdoc print the crate version into docsQuietMisdreavus-0/+6
2017-09-11rustc: use ty::Const for the length of TyArray.Eduard-Mihai Burtescu-0/+1
2017-08-30Print warning whatever the rendering modeGuillaume Gomez-1/+0
2017-08-30Update unstable-crate testGuillaume Gomez-1/+1
2017-08-30Add warnings when rustdoc html rendering differsGuillaume Gomez-0/+2
2017-08-25*: remove crate_{name,type} attributesTamir Duberstein-3/+0
Fixes #41701.
2017-08-15Fix typos & us spellingsFourchaux-1/+1
2017-08-10Implemented #[doc(cfg(...))].kennytm-0/+1
This attribute has two effects: 1. Items with this attribute and their children will have the "This is supported on **** only" message attached in the documentation. 2. The items' doc tests will be skipped if the configuration does not match.