Commit Graph

405 Commits

Author SHA1 Message Date
Guillaume Gomez 9ee69818f7 Add test when trying to add new theme 2018-02-08 10:53:09 +01:00
Guillaume Gomez b44b033bf1 get differences 2018-02-08 10:53:09 +01:00
Guillaume Gomez 94ad4e1d38 Add theme tests 2018-02-08 10:53:09 +01:00
Alex Crichton 884715c654 rustc: Load the `rustc_trans` crate at runtime
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-27 19:16:21 -08:00
bors 3a39b2aa5a Auto merge of #47620 - GuillaumeGomez:multiple-themes, r=QuietMisdreavus
Multiple themes for rustdoc

r? @QuietMisdreavus
2018-01-23 13:23:58 +00:00
Manish Goregaokar fe93adad2c Update to new commonmark arg 2018-01-22 16:25:59 +05:30
QuietMisdreavus 611866f3cf cleanup 2018-01-22 15:24:27 +05:30
Manish Goregaokar dae2e22e81 Make correct resolver available in rustdoc 2018-01-22 15:24:23 +05:30
QuietMisdreavus 5db40f7754 add RenderType to DocContext 2018-01-22 15:21:28 +05:30
Guillaume Gomez 9aee164a8e Add themes option 2018-01-21 17:35:35 +01:00
bjorn3 74c92c5562 Allow runtime switching between trans backends 2018-01-19 20:27:10 +01:00
Guillaume Gomez 49065a1419 Rollup merge of #47398 - GuillaumeGomez:pulldown-warnings, r=QuietMisdreavus
Switch to pulldown as default markdown renderer

r? @QuietMisdreavus
2018-01-17 23:43:28 +01:00
Guillaume Gomez f31204662b Switch to pulldown as default markdown renderer 2018-01-12 22:47:31 +01:00
Matt Brubeck 3f9c057ea6 Use the new fs_read_write functions in rustc internals 2018-01-10 14:53:40 -08:00
QuietMisdreavus e766f60c44 rustdoc: add option to abort process on markdown differences 2017-12-27 10:09:22 -06:00
varkor c0ff8144c4 Fix tidy issue 2017-12-18 19:52:45 +00:00
varkor 7104e8f7b4 Add an option to allow rustdoc to list modules by appearance
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-17 15:22:50 +00:00
Oliver Schneider d732da813b
Use PathBuf instead of String where applicable 2017-12-14 11:22:08 +01:00
Irina-Gabriela Popa 2c175df013 rustc_back: replace tempdir with crates.io version. 2017-12-04 18:25:31 +02:00
Christian Duerr ec337b613e
Show hidden items with rustdoc's document-private
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-30 21:18:00 +01:00
Lukas Kalbertodt 259c125267 Mark several ascii methods as unstable again
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-03 21:28:04 +01:00
Lukas Kalbertodt d425f8d226 Copy `AsciiExt` methods to `char` directly
This is done in order to deprecate AsciiExt eventually.
2017-11-03 21:27:40 +01:00
steveklabnik aad8787586 Create a new flag, --document-private-items
Fixes #44136
2017-10-17 10:54:27 -04:00
steveklabnik 4adf6aed69 Deprecate several flags in rustdoc
Part of #44136

Upgrades cargo due to https://github.com/rust-lang/cargo/pull/4451
2017-10-17 10:54:27 -04:00
Vadim Petrochenkov 9e0fc5ccd0 rustbuild: Support specifying archiver and linker explicitly 2017-10-15 22:10:07 +03:00
QuietMisdreavus fcee950660 let rustdoc print the crate version into docs 2017-10-09 09:56:17 -05:00
Eduard-Mihai Burtescu 8a9b78f5cc rustc: use ty::Const for the length of TyArray. 2017-09-11 08:41:15 +03:00
Guillaume Gomez f2774b7ac3 Print warning whatever the rendering mode 2017-08-30 09:40:43 +02:00
Guillaume Gomez e1367ef1b1 Update unstable-crate test 2017-08-30 09:40:43 +02:00
Guillaume Gomez 274543b9ca Add warnings when rustdoc html rendering differs 2017-08-30 09:40:43 +02:00
Tamir Duberstein b3f50caee0
*: remove crate_{name,type} attributes
Fixes #41701.
2017-08-25 16:18:21 -04:00
Fourchaux c7104be1a3 Fix typos & us spellings 2017-08-15 21:56:30 +02:00
kennytm a2b888675a
Implemented #[doc(cfg(...))].
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.
2017-08-10 13:43:59 +08:00
Mark Simulacrum e2e9b40e9a Build rustdoc on-demand.
Rustdoc is no longer compiled in every stage, alongside rustc, instead
it is only compiled when requested, and generally only for the last
stage.
2017-07-27 05:51:22 -06:00
Mark Simulacrum 7f693e2cb9 Rollup merge of #42806 - ollie27:rustbuild_compiler_docs, r=alexcrichton
rustbuild: Fix compiler docs yet again

Add support for `-Z force-unstable-if-unmarked` to rustdoc.

r? @alexcrichton
2017-06-22 06:30:12 -06:00
Oliver Middleton ae1dc2a6f9 rustbuild: Fix compiler docs yet again
Add support for `-Z force-unstable-if-unmarked` to rustdoc.
2017-06-21 17:59:10 +01:00
Alex Crichton 5c3d0e6de3 Switch to the crates.io `getopts` crate
This commit deletes the in-tree `getopts` crate in favor of the crates.io-based
`getopts` crate. The main difference here is with a new builder-style API, but
otherwise everything else remains relatively standard.
2017-06-20 12:43:12 -07:00
Alex Crichton be7ebdd512 Bump version and stage0 compiler 2017-06-19 22:25:05 -07:00
bors ffb0e2dba3 Auto merge of #41700 - GuillaumeGomez:extend-css-stable, r=killercup
Set --extend-css stable

I think it's now time to set this option stable.

r? @rust-lang/docs
2017-05-25 04:38:53 +00:00
Guillaume Gomez b4d594f46c Add precisions for the help message for --extend-css 2017-05-24 00:15:26 +02:00
Josh Stone e86588e228 Give a nicer error for non-Unicode arguments to rustc and rustdoc
Previously, any non-Unicode argument would panic rustc:

```
$ rustc $'foo\x80bar'
error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report:
https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value:
"foo�bar"', /checkout/src/libcore/result.rs:859 note: Run with
`RUST_BACKTRACE=1` for a backtrace.
```

Now it gives a clean error:

```
$ rustc $'foo\x80bar'
error: Argument 1 is not valid Unicode: "foo�bar"
```

Maybe fixes #15890, although we still can't *compile* arbitrary file names.
2017-05-18 16:11:22 -07:00
Mark Simulacrum 27ea129dd3 Rollup merge of #41826 - GuillaumeGomez:add-markdown-content, r=frewsxcv
Add markdown-[before|after]-content options

cc @nical

r? @rust-lang/docs
2017-05-13 20:55:09 -06:00
Alex Crichton ab54f4b226 rustc: Remove #![unstable] annotation
These are now no longer necessary with `-Z force-unstable-if-unmarked`
2017-05-11 16:03:05 -07:00
Guillaume Gomez 95a94e3d3d Add markdown-[before|after]-content options 2017-05-08 14:25:01 +02:00
Corey Farwell ecd7b48b25 Rollup merge of #41678 - GuillaumeGomez:rustdoc-test-warnings, r=alexcrichton
Add option to display warnings in rustdoc

Part of #41574.

r? @alexcrichton

The output for this file:

```rust
/// ```
/// fn foo(x: u32) {}
///
/// foo(2);
/// let x = 1;
/// panic!();
/// ```
fn foo() {}

/// ```
/// fn foo(x: u32) {}
///
/// foo(2);
/// let x = 1;
/// ```
fn foo2() {}

/// ```
/// fn foo(x: u32) {}
///
/// foo(2);
/// let x = 1;
/// panic!();
/// ```
fn foo3() {}

fn main() {
}
```

is the following:

```
> ./build/x86_64-apple-darwin/stage1/bin/rustdoc -Z unstable-options --display-warnings --test test.rs

running 3 tests
test test.rs - foo (line 1) ... FAILED
test test.rs - foo3 (line 18) ... FAILED
test test.rs - foo2 (line 10) ... ok

successes:

---- test.rs - foo2 (line 10) stdout ----
	warning: unused variable: `x`
 --> <anon>:2:8
  |
2 | fn foo(x: u32) {}
  |        ^
  |
  = note: #[warn(unused_variables)] on by default

warning: unused variable: `x`
 --> <anon>:5:5
  |
5 | let x = 1;
  |     ^
  |
  = note: #[warn(unused_variables)] on by default

successes:
    test.rs - foo2 (line 10)

failures:

---- test.rs - foo (line 1) stdout ----
	warning: unused variable: `x`
 --> <anon>:2:8
  |
2 | fn foo(x: u32) {}
  |        ^
  |
  = note: #[warn(unused_variables)] on by default

warning: unused variable: `x`
 --> <anon>:5:5
  |
5 | let x = 1;
  |     ^
  |
  = note: #[warn(unused_variables)] on by default

thread 'rustc' panicked at 'test executable failed:

thread 'main' panicked at 'explicit panic', <anon>:6
note: Run with `RUST_BACKTRACE=1` for a backtrace.

', src/librustdoc/test.rs:317
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- test.rs - foo3 (line 18) stdout ----
	warning: unused variable: `x`
 --> <anon>:2:8
  |
2 | fn foo(x: u32) {}
  |        ^
  |
  = note: #[warn(unused_variables)] on by default

warning: unused variable: `x`
 --> <anon>:5:5
  |
5 | let x = 1;
  |     ^
  |
  = note: #[warn(unused_variables)] on by default

thread 'rustc' panicked at 'test executable failed:

thread 'main' panicked at 'explicit panic', <anon>:6
note: Run with `RUST_BACKTRACE=1` for a backtrace.

', src/librustdoc/test.rs:317

failures:
    test.rs - foo (line 1)
    test.rs - foo3 (line 18)

test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured
```
2017-05-05 17:35:27 -04:00
Niko Matsakis 196c98d314 remove use of `ast_ty_to_ty_cache` from librustdoc 2017-05-03 21:26:28 -04:00
Guillaume Gomez f30ed77f0d Add option to display warnings in rustdoc 2017-05-02 13:57:08 +02:00
Guillaume Gomez 7d4a6c8ec1 Set --extend-css stable 2017-05-02 12:25:36 +02:00
Guillaume Gomez 80a2a94d5a Re-enable hoedown by default 2017-04-22 13:25:14 +02:00
Guillaume Gomez a65461005a Fix line display for hoedown 2017-04-20 20:20:40 +02:00