summary refs log tree commit diff
path: root/src/librustc_driver/lib.rs
AgeCommit message (Collapse)AuthorLines
2018-04-18Use #[no_debug] to work around LLVM problem with rustc_driver::get_trans::LOAD.Michael Woerister-0/+4
2018-03-25Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoeristerkennytm-24/+30
Always print `aborting due to n previous error(s)` r? @michaelwoerister
2018-03-17Auto merge of #48904 - Zoxc:code-and-file-maps, r=michaelwoeristerbors-2/+2
Make CodeMap and FileMap thread-safe r? @michaelwoerister
2018-03-16Always print `aborting due to n previous error(s)` and only print it once ↵John Kåre Alsaker-24/+30
for multi-threaded code
2018-03-15Require a thread-safe file loaderJohn Kåre Alsaker-2/+2
2018-03-15Rollup merge of #48993 - alexheretic:fix-48816, r=michaelwoeristerkennytm-0/+6
fix #48816 don't print help on indirect compiler ICE https://github.com/rust-lang/rust/issues/48816#issuecomment-372817573
2018-03-15Rollup merge of #48765 - Phlosioneer:10234-wall-help-message, r=estebankkennytm-0/+16
Add info message for -Wall command Users coming from other languages (namely C and C++) often expect to use a -Wall flag. Rustc doesn't support that, and previously it simply printed that it didn't recognize the "all" lint. This change makes rustc print out a help message, explaining: - Why there is no -Wall flag - How to view all the available warnings - Point out that the most commonly used warning is -Wunused - Instead of using a command-line flag, the user should consider a !#[warn(unused)] directive in the root of their crate. I tried to keep the language consistent with the other usage help. Comment if I should change anything. closes #10234, if accepted.
2018-03-14Remove syntax and syntax_pos thread localsJohn Kåre Alsaker-0/+11
2018-03-13fix #48816 don't print help on indirect compiler ICEAlex Butler-0/+6
2018-03-13introduce `infcx.at(..).normalize(..)` operation [VIC]Niko Matsakis-0/+1
It is backed by the new `normalize_projection_ty` query, which uses canonicalization.
2018-03-12Update -Wall message based on feedbackPhlosioneer-4/+3
The reference to -Wunused was removed, and some phrasing was changed.
2018-03-09Move PROFQ_CHAN to a Session fieldJohn Kåre Alsaker-1/+1
2018-03-08Allow tools (e.g. miri) to enable rust loggingOliver Schneider-1/+7
2018-03-08Move librustc_const_eval to librustc_mirOliver Schneider-2/+0
2018-03-06Fix trailing whitespacePhlosioneer-1/+1
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-06Add info message for -Wall commandPhlosioneer-0/+17
Users coming from other languages (namely C and C++) often expect to use a -Wall flag. Rustc doesn't support that, and previously it simply printed that it didn't recognize the "all" lint. This change makes rustc print out a help message, explaining: - Why there is no -Wall flag - How to view all the available warnings - Point out that the most commonly used warning is -Wunused - Instead of using a command-line flag, the user should consider a !#[warn(unused)] directive in the root of their crate.
2018-03-04Rollup merge of #48664 - Keruspe:codegen, r=alexcrichtonkennytm-1/+3
make codegen-backends directory name configurable This allows to parallel-install several versions of rust system-wide Fixes #48263
2018-03-02make codegen-backends directory name configurableMarc-Antoine Perennou-1/+3
This allows to parallel-install several versions of rust system-wide Fixes #48263 Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-03-02Replace Rc with Lrc for shared dataJohn Kåre Alsaker-2/+2
2018-02-28Rollup merge of #48461 - Manishearth:epoch-dyn-trait, r=nmatsakisManish Goregaokar-10/+10
Fixes #47311. r? @nrc
2018-02-28Rollup merge of #48266 - pietroalbini:report-compiler-flags-on-ice, ↵kennytm-5/+80
r=michaelwoerister Report non-standard compile flags on ICE Some ICEs (such as the recent #48248) only happens when a non-standard compiler flag is provided to rustc, but users don't always report the used flags. This can slow down reproducing the issue, so this PR shows all the non-standard compiler flags in the ICE error message. For example, the output of #48248 with this PR is: ``` error: internal compiler error: [...] thread 'rustc' panicked at [...] note: Run with `RUST_BACKTRACE=1` for a backtrace. note: the compiler unexpectedly panicked. this is a bug. note: we would appreciate a bug report: [...] note: rustc 1.25.0-dev running on x86_64-unknown-linux-gnu note: compiler flags: -C link-dead-code ``` ### Open questions * At the moment, only `-C` and `-Z` flags are shown by default, and all the ones provided by cargo in a standard build are ignored: I did this to only show the flags that probably caused the ICE, and to remove some noise from the message. This removed flags like `opt-level` and `debuginfo` though, could those be useful for reproducing ICEs?
2018-02-23Report non-standard compile flags on ICEPietro Albini-5/+80
2018-02-23Allow future-incompat lints to mention an epochManish Goregaokar-10/+10
2018-02-20stage0 cfg cleanupMark Simulacrum-8/+0
2018-01-31Auto merge of #47900 - kennytm:rollup, r=kennytmbors-8/+23
Rollup of 16 pull requests - Successful merges: #47838, #47840, #47844, #47874, #47875, #47876, #47884, #47886, #47889, #47890, #47891, #47795, #47677, #47893, #47895, #47552 - Failed merges:
2018-02-01Rollup merge of #47895 - varkor:non-utf-stdin, r=estebankkennytm-7/+22
Fix ICE when reading non-UTF-8 input from stdin Fixes #22387.
2018-01-31rustc: Move location of `codegen-backends` dirAlex Crichton-1/+1
Right now this directory is located under: $sysroot/lib/rustlib/$target/lib/codegen-backends but after seeing what we do in a few other places it seems that a more appropriate location would be: $sysroot/lib/rustlib/$target/codegen-backends so this commit moves it!
2018-01-31Auto merge of #45752 - estebank:highlight-primary, r=nikomatsakisbors-1/+3
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-31Fix ICE when reading non-UTF-8 input from stdinvarkor-7/+22
Fixes #22387.
2018-01-29Toggle span highlighting on `-Zteach`Esteban Küber-1/+3
2018-01-28rustc: Split Emscripten to a separate codegen backendAlex Crichton-15/+14
This commit introduces a separately compiled backend for Emscripten, avoiding compiling the `JSBackend` target in the main LLVM codegen backend. This builds on the foundation provided by #47671 to create a new codegen backend dedicated solely to Emscripten, removing the `JSBackend` of the main codegen backend in the process. A new field was added to each target for this commit which specifies the backend to use for translation, the default being `llvm` which is the main backend that we use. The Emscripten targets specify an `emscripten` backend instead of the main `llvm` one. There's a whole bunch of consequences of this change, but I'll try to enumerate them here: * A *second* LLVM submodule was added in this commit. The main LLVM submodule will soon start to drift from the Emscripten submodule, but currently they're both at the same revision. * Logic was added to rustbuild to *not* build the Emscripten backend by default. This is gated behind a `--enable-emscripten` flag to the configure script. By default users should neither check out the emscripten submodule nor compile it. * The `init_repo.sh` script was updated to fetch the Emscripten submodule from GitHub the same way we do the main LLVM submodule (a tarball fetch). * The Emscripten backend, turned off by default, is still turned on for a number of targets on CI. We'll only be shipping an Emscripten backend with Tier 1 platforms, though. All cross-compiled platforms will not be receiving an Emscripten backend yet. This commit means that when you download the `rustc` package in Rustup for Tier 1 platforms you'll be receiving two trans backends, one for Emscripten and one that's the general LLVM backend. If you never compile for Emscripten you'll never use the Emscripten backend, so we may update this one day to only download the Emscripten backend when you add the Emscripten target. For now though it's just an extra 10MB gzip'd. Closes #46819
2018-01-27rustc: Load the `rustc_trans` crate at runtimeAlex Crichton-48/+242
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-26Do not capture stderr in the compiler. Instead just panic silently for fatal ↵John Kåre Alsaker-28/+7
errors
2018-01-25Rollup merge of #47679 - etaoins:remove-redundant-backtrace-hint, r=estebankGuillaume Gomez-8/+0
Remove broken redundant backtrace hint When the compiler driver panics it attempts to show a hint about using `RUST_BACKTRACE`. However, the logic is currently reversed to the hint is only shown if `RUST_BACKTRACE` is **already** set: ```shell > RUST_BACKTRACE=1 rustc /dev/null --crate-type proc-macro error: internal compiler error: unexpected panic ... note: run with `RUST_BACKTRACE=1` for a backtrace thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. > RUST_BACKTRACE=0 rustc /dev/null --crate-type proc-macro error: internal compiler error: unexpected panic ... thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` As the `panic` itself already has a working `RUST_BACKTRACE` hint just remove the broken duplicate hint entirely.
2018-01-23Rollup merge of #47661 - bjorn3:refactor_driver, r=michaelwoeristerkennytm-18/+13
Inline some rustc_driver function
2018-01-23Remove broken redundant backtrace hintRyan Cumming-8/+0
When the compiler driver panics it attempts to show a hint about using `RUST_BACKTRACE`. However, the logic is currently reversed to the hint is only shown if `RUST_BACKTRACE` is *already* set: ```shell > RUST_BACKTRACE=1 rustc /dev/null --crate-type proc-macro error: internal compiler error: unexpected panic ... note: run with `RUST_BACKTRACE=1` for a backtrace thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49 note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. > RUST_BACKTRACE=0 rustc /dev/null --crate-type proc-macro error: internal compiler error: unexpected panic ... thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49 note: Run with `RUST_BACKTRACE=1` for a backtrace. ``` As the `panic` itself already has a working `RUST_BACKTRACE` hint just remove the broken duplicate hint entirely.
2018-01-23Rollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakiskennytm-2/+3
Change the --unpretty flag to -Z unpretty First PR :smile: ! -Z unpretty no longer requires -Z unstable-options. Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI). Fix #47395 r? @nikomatsakis EDIT: apparently rust-highfive doesn't see edits...
2018-01-22Inline some rustc_driver functionbjorn3-18/+13
2018-01-19Just forget the DynamicLibrary after getting a hot plugged backendbjorn3-59/+2
2018-01-19Fix hotplug backend and add testbjorn3-0/+8
2018-01-19Fix review commentsbjorn3-3/+78
2018-01-19Cleanup hot plug codegen backend codebjorn3-1/+1
2018-01-19Hot plug rustc_transbjorn3-0/+3
2018-01-19Allow runtime switching between trans backendsbjorn3-64/+73
2018-01-18Change the --unpretty flag to -Z unprettyMark Mansi-2/+3
-Z unpretty no longer requires -Z unstable-options. Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI).
2018-01-07Remove redundant -Zdebug-llvm optionBjörn Steinbrink-5/+0
The same effect can be achieved using -Cllvm-args=-debug Refs #46437 as it removes LLVMRustSetDebug()
2018-01-04rustc: Don't use relative paths for extended errorsAlex Crichton-0/+8
These no longer work now that Cargo changes the cwd of rustc while it's running. Instead use an absolute path that's set by rustbuild.
2017-12-22Auto merge of #46779 - Zoxc:par-merge-without-sync, r=arielb1bors-3/+2
Work towards thread safety in rustc This PR is split out from https://github.com/rust-lang/rust/pull/45912. It contains changes which do not require the `sync` module.
2017-12-21Remove useless RcJohn Kåre Alsaker-2/+2