summary refs log tree commit diff
path: root/src/librustc_driver/lib.rs
AgeCommit message (Collapse)AuthorLines
2019-10-25Remove lint callback from driverMark Rousskov-2/+0
This is leftover from a restructuring of lint registration for drivers; it should now happen via the register_lints field on Config rather than this function.
2019-10-24rustc_driver: Remove unnecessary use of crate storeVadim Petrochenkov-4/+4
2019-10-23Rollup merge of #65193 - Mark-Simulacrum:lockless-lintstore, r=nikomatsakisMazdak Farrokhzad-9/+18
Lockless LintStore This removes mutability from the lint store after registration. Each commit stands alone, for the most part, though they don't make sense out of sequence. The intent here is to move LintStore to a more parallel-friendly architecture, although also just a cleaner one from an implementation perspective. Specifically, this has the following changes: * We no longer implicitly register lints when registering lint passes * For the most part this means that registration calls now likely want to call something like: `lint_store.register_lints(&Pass::get_lints())` as well as `register_*_pass`. * In theory this is a simplification as it's much easier for folks to just register lints and then have passes that implement whichever lint however they want, rather than necessarily tying passes to lints. * Lint passes still have a list of associated lints, but a followup PR could plausibly change that * This list must be known for a given pass type, not instance, i.e., `fn get_lints()` is the signature instead of `fn get_lints(&self)` as before. * We do not store pass objects, instead storing constructor functions. This means we always get new passes when running lints (this happens approximately once though for a given compiler session, so no behavior change is expected). * Registration API is _much_ simpler: generally all functions are just taking `Fn() -> PassObject` rather than several different `bool`s.
2019-10-22Add some documentationMark Rousskov-0/+1
2019-10-19move parse_cfgspecs to rustc_interfaceMazdak Farrokhzad-1/+1
2019-10-17Update API to be more compatible with plugin needsMark Rousskov-0/+3
Move to using Box<dyn Fn() -> ...> so that we can let plugins register state. This also adds a callback that'll get called from plugin registration so that Clippy and other tools can register lints without using the plugin API. The plugin API still works, but this new API is more compatible with drivers other than rustc.
2019-10-17Create lint store during plugin registrationMark Rousskov-6/+12
Remove lint store from Session
2019-10-17Lints being from a plugin is dependent on the lint, not the registrationMark Rousskov-3/+2
2019-10-14rustc_metadata: Privatize private code and remove dead codeVadim Petrochenkov-1/+1
2019-10-13refactor session::config::build_session_options_and_crate_configMazdak Farrokhzad-1/+2
2019-09-29Rollup merge of #64799 - Aaron1011:fix/double-panic, r=Mark-SimulacrumMazdak Farrokhzad-1/+1
Fix double panic when printing query stack during an ICE On the latest nightly, any call to `bug` or `span_bug` will result in two panics - the first one as a normal result of calling `bug` / `span_bug`, and the second as a result of trying to print the query stack from the panic handler. This is caused by the query-printing code attempting to acquire a lock on `HandlerInnder`, which is still being held by `bug`. This PR moves the actual panic out of `HandlerInner`, into `Handler`. This allows us to release the lock on `HandlerInner` before triggering the panic, ensuring that the panic handler will be able to acquire the lock if necessary.
2019-09-26Use existing Handler to print query stackAaron Hill-1/+1
When the panic handler is run, the existing Handler may be in a weird state if it was responsible for triggering the panic. By using a freshly created Handler, we avoid trying to re-entrantly lock a HandlerInner, which was causing a double panic on ICEs.
2019-09-26Rename `MetaItem.node` to `MetaItem.kind`varkor-1/+1
2019-09-23Introduce a diagnostic stashing API.Mazdak Farrokhzad-2/+1
2019-09-17Remove Handler::{emit, emit_with_code}Mark Rousskov-7/+5
2019-09-17Replace DiagnosticBuilder with Diagnostic when emitting errorMark Rousskov-0/+1
2019-09-16Rollup merge of #64497 - nnethercote:fix-64339, r=petrochenkovMazdak Farrokhzad-1/+4
Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given Fixes #64339.
2019-09-16Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given.Nicholas Nethercote-1/+4
Fixes #64339.
2019-09-15Auto merge of #60584 - jonas-schievink:ice-panic-hook, r=oli-obkbors-49/+94
Use `panic::set_hook` to print the ICE message This allows custom frontends and backends to override the hook with their own, for example to point people to a different issue tracker. ICE messages are printed in a slightly different order now. Nightly prints: ``` thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21 note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0658. For more information about an error, try `rustc --explain E0277`. 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 note: rustc 1.36.0-nightly (08bfe1612 2019-05-02) running on x86_64-unknown-linux-gnu ``` After this PR, rustc prints: ``` thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21 note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. 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 note: rustc 1.36.0-dev running on x86_64-unknown-linux-gnu error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0658. For more information about an error, try `rustc --explain E0277`. ```
2019-09-05Remove rustc_diagnostic_macros featureMark Rousskov-1/+0
2019-08-30Update commentJonas Schievink-1/+1
2019-08-30Document the ICE hook and make it more flexibleJonas Schievink-3/+12
2019-08-30Clarify that rustc unwinds on errors, not panicsJonas Schievink-1/+1
2019-08-30Move librustc panic handler into the new oneJonas Schievink-5/+22
2019-08-30Use `panic::set_hook` to print the ICE messageJonas Schievink-45/+64
2019-08-30Auto merge of #63827 - andjo403:out-of-process-rustc-in-rustdoc, ↵bors-0/+9
r=Mark-Simulacrum Run doctests via out-of-process rustc closes #63638
2019-08-30Auto merge of #63402 - estebank:strip-margin, r=oli-obkbors-5/+7
Strip code to the left and right in diagnostics for long lines Fix #62999.
2019-08-29support rustdoc test from stdin to rustcAndreas Jonson-0/+9
2019-08-22Auto merge of #63175 - jsgf:argsfile, r=jsgfbors-8/+29
rustc: implement argsfiles for command line Many tools, such as gcc and gnu-ld, support "args files" - that is, being able to specify @file on the command line. This causes `file` to be opened and parsed for command line options. They're separated with whitespace; whitespace can be quoted with double or single quotes, and everything can be \\-escaped. Args files may recursively include other args files via `@file2`. See https://sourceware.org/binutils/docs/ld/Options.html#Options for the documentation of gnu-ld's @file parameters. This is useful for very large command lines, or when command lines are being generated into files by other tooling.
2019-08-21Add terminal_width debugging flagEsteban Küber-5/+7
2019-08-20Move argfile expansion into run_compilerJeremy Fitzhardinge-6/+14
This will make @path work with miri and other non-standard entrypoints. Also since this simplifies librustc_driver::args, move it into a simple source file. Also remove the tests since they're doing nothing more than checking `str::lines` has the right behaviour.
2019-08-19rustc: implement argsfiles for command lineJeremy Fitzhardinge-4/+17
This makes `rustc` support `@path` arguments on the command line. The `path` is opened and the file is interpreted as new command line options which are logically inserted at that point in the command-line. The options in the file are one per line. The file is UTF-8 encoded, and may have either Unix or Windows line endings. It does not support recursive use of `@path`. This is useful for very large command lines, or when command-lines are being generated into files by other tooling.
2019-08-19Use named arguments for formatting usage message.Jeremy Fitzhardinge-5/+5
It was getting a bit awkward.
2019-08-20Deprecate using rustc_plugin without the rustc_driver dylib.Simon Sapin-0/+2
CC https://github.com/rust-lang/rust/pull/59800 https://github.com/rust-lang/rust/commit/7198687bb2df13a3298ef1e8f594753073d6b9e8 Fix https://github.com/rust-lang/rust/issues/62717
2019-08-15`Ident::with_empty_ctxt` -> `Ident::with_dummy_span`Vadim Petrochenkov-1/+1
`Ident` has had a full span rather than just a `SyntaxContext` for a long time now.
2019-08-09Cleanup historical stability commentsMark Rousskov-15/+6
These weren't removed by ccbcc720a679ae76155a8 most likely by accident, let's clean them up now.
2019-07-28Deny `unused_lifetimes` through rustbuildVadim Petrochenkov-2/+0
2019-07-28Remove lint annotations in specific crates that are already enforced by ↵Vadim Petrochenkov-1/+0
rustbuild Remove some random unnecessary lint `allow`s
2019-07-23cleanup: Remove `extern crate serialize as rustc_serialize`sVadim Petrochenkov-1/+1
2019-07-15Use more descriptive Compilation enum in rustc interface callbacksIgor Matuszewski-12/+15
2019-07-15Add Callbacks::after_expansionIgor Matuszewski-0/+9
2019-07-05Rollup merge of #62110 - nnethercote:improve-Ztime-passes, r=ZoxcMazdak Farrokhzad-6/+26
Improve -Ztime-passes Two improvements that make `-Ztime-passes` more useful. r? @Zoxc
2019-07-05Add a "total" measurement to -Ztime-passes.Nicholas Nethercote-6/+26
This is useful for getting the total compilation time at the end. To do this, the patch changes `print_time_passes_entry` to not increment the depth, which means that `print_time_passes_entry_internal` is no longer needed.
2019-06-24Enable internal lints in bootstrapflip1995-1/+0
2019-06-11Add deny(unused_lifetimes) to all the crates that have deny(internal).Eduard-Mihai Burtescu-0/+1
2019-05-13Remove the equality operation between `Symbol` and strings.Nicholas Nethercote-1/+2
And also the equality between `Path` and strings, because `Path` is made up of `Symbol`s.
2019-04-30Rename to RUSTC_LOGYuki OKUSHI-1/+1
2019-04-17Deny `internal` in stage0Mateusz Mikuła-1/+1
2019-04-12Rollup merge of #59680 - DevQps:document-rustc-z-flag, r=cramertjMazdak Farrokhzad-2/+2
Document the -Z flag to the rustc book # Description Changes: - Added new documentation on the `-Z` flag of rustc in the command-line arguments section of the rustc book. If I need to rephrase anything or if you have any improvements, please let me know! I deliberately did not create an exhaustive list of all options since they are likely to change over time and per toolchain version. closes #41142
2019-04-10Updated the documentation, now claiming the -Z is associated to unstable ↵Christian-2/+2
compiler flags, instead of flags for debugging.