Commit Graph

341 Commits

Author SHA1 Message Date
bors 560a2f4faf Auto merge of #45752 - estebank:highlight-primary, r=nikomatsakis
Highlight code on diagnostics when underlined

Highlight the label's span with the respective color:

<img width="692" alt="" src="https://user-images.githubusercontent.com/1606434/32411026-a1842482-c18d-11e7-9933-6510eefbad19.png">

Fix #42112.
2018-01-31 07:53:57 +00:00
Esteban Küber 08287c1e26 Toggle span highlighting on `-Zteach` 2018-01-29 08:59:15 -08: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
bjorn3 74c92c5562 Allow runtime switching between trans backends 2018-01-19 20:27:10 +01:00
Manish Goregaokar 730679685e Use correct line offsets for doctests (fixes #45868) 2018-01-10 10:10:34 +05:30
kennytm 0ee069c70a Rollup merge of #46814 - varkor:contrib-7, r=alexcrichton
Prevent rustc overwriting input files

If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves #13019. Kudos to @estebank, whose patch I finished off.
2017-12-22 02:50:49 +08:00
kennytm 71c6d23612 Rollup merge of #46636 - frewsxcv:frewsxcv-fn-box, r=estebank
Replace libtest/lib.rs:FnBox with std::boxed::FnBox.

Fixes https://github.com/rust-lang/rust/issues/41810.
2017-12-22 02:50:45 +08:00
varkor b59fbfdbe1 Move source-output conflict checking into `compile_input` 2017-12-19 01:54:00 +00:00
Corey Farwell 4f04f975ae Replace libtest/lib.rs:FnBox with std::boxed::FnBox.
Fixes https://github.com/rust-lang/rust/issues/41810.
2017-12-15 09:11:14 -05: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
Irina-Gabriela Popa dda924ab6a rustc_back: move dynamic_lib to rustc_metadata. 2017-12-04 18:25:29 +02:00
Alex Crichton 48996f9e75 rustbuild: Enable WebAssembly backend by default
This commit alters how we compile LLVM by default enabling the WebAssembly
backend. This then also adds the wasm32-unknown-unknown target to get compiled
on the `cross` builder and distributed through rustup. Tests are not yet enabled
for this target but that should hopefully be coming soon!
2017-11-25 06:44:35 -08:00
QuietMisdreavus f9f3611f5c allow loading external files in documentation
Partial implementation of https://github.com/rust-lang/rfcs/pull/1990
(needs error reporting work)

cc #44732
2017-11-21 15:46:49 -06:00
Alex Burka b34a7ffb25 address review comments 2017-11-20 18:03:20 +00:00
Alex Burka 30a661409c tidy 😡 2017-11-20 01:23:44 +00:00
Alex Burka 7a5a1f9857 use -Z flag instead of env var 2017-11-19 22:30:14 +00:00
QuietMisdreavus 5abc524073 rustdoc: add #[allow(unused)] to every doctest
also modify the order crate attributes are applied, to have a better
order of how things can override lints, either per-crate or per-test
2017-11-05 09:30:00 -06:00
Guillaume Gomez 83bca40350 Add short message-format 2017-10-20 16:04:32 +02:00
Vadim Petrochenkov 9e0fc5ccd0 rustbuild: Support specifying archiver and linker explicitly 2017-10-15 22:10:07 +03:00
bors a457e29811 Auto merge of #44867 - kennytm:rustdoc-md-test-title, r=alexcrichton
doc-test: In Markdown tests, Use all of `<h1>` to `<h6>` as the test name

This mainly simplifies debugging error index tests, as the error codes are `<h2>`s in the huge document containing all codes.
2017-10-14 23:07:35 +00:00
bors 13ae187043 Auto merge of #44822 - frewsxcv:frewsxcv-eprintln, r=Kimundi
Migrate to eprint/eprintln macros where appropriate.

None
2017-10-10 02:54:14 +00:00
kennytm 0cdf587ab3
doc-test: In Markdown tests, Use all of `<h1>` to `<h6>` as the test name.
This mainly simplifies debugging error index tests, as the error codes are
`<h2>`s in the huge document containing all codes.
2017-10-08 00:49:33 +08:00
Philip Craig 9bbd7a3b3f Add fixme regarding remapping paths for doctests 2017-10-03 20:36:53 +10:00
Corey Farwell 8ef5447815 Migrate to eprint/eprintln macros where appropriate. 2017-09-28 11:38:35 -04:00
Zack M. Davis 9f68d62e0c don't let rustdoc get confused by text "fn main" in a line comment
This is in the matter of #21299.
2017-09-26 16:00:54 -07:00
Michael Woerister 47d14ccd51 incr.comp.: Remove IncrementalHashesMap and calculate_svh module. 2017-09-20 11:21:25 +02:00
Michael Woerister d5b1fee6fd incr.comp.: Remove tcx from StableHashingContext. 2017-09-18 11:29:47 +02:00
Alex Crichton 1cf956f2ba rustc: Remove `Session::dep_graph`
This commit removes the `dep_graph` field from the `Session` type according to
issue #44390. Most of the fallout here was relatively straightforward and the
`prepare_session_directory` function was rejiggered a bit to reuse the results
in the later-called `load_dep_graph` function.

Closes #44390
2017-09-14 10:40:50 -07:00
Michael Woerister 54fa047d92 Remove the `cstore` reference from Session in order to prepare encapsulating CrateStore access in tcx. 2017-09-12 07:19:06 -07:00
Alex Crichton d724d03389 rustc: Remove `DepGraph` handling from rustc_metadata
This should now be entirely tracked through queries, so no need to have a
`DepGraph` in the `CStore` object any more!
2017-09-09 21:11:25 -07:00
Vadim Petrochenkov 3da868dcb6 Make fields of `Span` private 2017-08-30 01:38:54 +03:00
Zack M. Davis 1b6c9605e4 use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
Guillaume Gomez 7ebd81377d Rollup merge of #43782 - nrc:include, r=GuillaumeGomez
Fix include! in doc tests

By making the path relative to the current file.

Fixes #43153

[breaking-change] - if you use `include!` inside a doc test, you'll need to change the path to be relative to the current file rather than relative to the working directory.
2017-08-13 11:03:09 +02:00
Nick Cameron 6d736df76b doc tests: use the filename from the source file for doc test programs, rather than a dummy name 2017-08-10 17:59:20 +12: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
kennytm 8f935fbb5b
Strip out function implementation when documenting.
This prevents compilation failure we want to document a platform-specific
module. Every function is replaced by `loop {}` using the same construct
as `--unpretty everybody_loops`.

Note also a workaround to #43636 is included: `const fn` will retain their
bodies, since the standard library has quite a number of them.
2017-08-10 13:43:57 +08:00
Nick Cameron a9a181d4dc driver: factor out `continue_parse_after_error` so it can be controlled via driver API 2017-08-10 10:14:17 +12:00
Ariel Ben-Yehuda fb7ab9e43d report the total number of errors on compilation failure
Prior to this PR, when we aborted because a "critical pass" failed, we
displayed the number of errors from that critical pass. While that's the
number of errors that caused compilation to abort in *that place*,
that's not what people really want to know. Instead, always report the
total number of errors, and don't bother to track the number of errors
from the last pass that failed.

This changes the compiler driver API to handle errors more smoothly,
and therefore is a compiler-api-[breaking-change].

Fixes #42793.
2017-07-02 16:16:44 +03:00
Paul Woolcock 60dd83ea85 add `allow_fail` test attribute
This change allows the user to add an `#[allow_fail]` attribute to
tests that will cause the test to compile & run, but if the test fails
it will not cause the entire test run to fail. The test output will
show the failure, but in yellow instead of red, and also indicate that
it was an allowed failure.
2017-06-24 06:42:29 -04:00
Robin Kruppe 8e4f315116 Remove rustc_llvm dependency from librustc
Consequently, session creation can no longer initialize LLVM.
The few places that use the compiler without going through
rustc_driver/CompilerCalls thus need to be careful to manually
initialize LLVM (via rustc_trans!) immediately after session
creation.

This means librustc is not rebuilt when LLVM changes.
2017-05-15 11:13:30 +02:00
Robin Kruppe 1a24a591dd Remove rustc_llvm dependency from rustc_metadata
Move the code for loading metadata from rlibs and dylibs from
rustc_metadata into rustc_trans, and introduce a trait to avoid
introducing a direct dependency on rustc_trans.

This means rustc_metadata is no longer rebuilt when LLVM changes.
2017-05-14 20:30:22 +02:00
Guillaume Gomez d5863e9985 Add Options type in libtest and remove argument 2017-05-05 10:52:10 +02:00
Guillaume Gomez f30ed77f0d Add option to display warnings in rustdoc 2017-05-02 13:57:08 +02:00
Michael Woerister 39ffea31df Implement a file-path remapping feature in support of debuginfo and reproducible builds. 2017-04-26 15:44:02 +02:00
Guillaume Gomez 9c97882055 Fix line display 2017-04-22 14:56: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
Guillaume Gomez cbf8342efe Hoedown big comeback! 2017-04-17 18:10:03 +02:00
Jeffrey Seyfried 68c1cc68b4 Refactor `Attribute` to use `Path` and `TokenStream` instead of `MetaItem`. 2017-03-14 04:03:43 +00:00