about summary refs log tree commit diff
path: root/src/librustc_session
AgeCommit message (Collapse)AuthorLines
2020-01-28lintify conflicting_repr_hintsMazdak Farrokhzad-0/+11
2020-01-24Rollup merge of #68473 - nopsledder:rust_sanitizer_fuchsia, r=alexcrichtonTyler Mandry-2/+6
Enable ASan on Fuchsia This change adds the x86_64-fuchsia and aarch64-fuchsia LLVM targets to those allowed to invoke -Zsanitizer. Currently, the only overlap between compiler_rt sanitizers supported by both rustc and Fuchsia is ASan.
2020-01-22Rollup merge of #68409 - sinkuu:temp_path, r=Mark-SimulacrumTyler Mandry-11/+20
Micro-optimize OutputFilenames For example, its methods consume 6% of time during debug-compiling a `warp` example: ![Screenshot (debug-compiling a `warp` example)](https://user-images.githubusercontent.com/7091080/72780288-d74f1580-3c61-11ea-953b-34e59ca682f9.png) This PR optimize them a bit by using `PathBuf::set_extension` instead of `Path::with_extension`, to avoid cloning `PathBuf` excessively.
2020-01-23Add `-Z no-link` flagVictor Ding-2/+4
Adds a compiler option to allow rustc compile a crate without linking. With this flag, rustc serializes codegen_results into a .rlink file.
2020-01-22Fix tidy warningsAaron Green-2/+6
2020-01-22Enable ASan on FuchsiaAaron Green-1/+1
This change adds the x86_64-fuchsia and aarch64-fuchsia LLVM targets to those allowed to invoke -Zsanitizer. Currently, the only overlap between compiler_rt sanitizers supported by both rustc and Fuchsia is ASan.
2020-01-22Do not base path to append extensionMark Rousskov-4/+4
We already have ownership of the base path, so no need to clone it (within Path::with_extension).
2020-01-22Store filestem in a pre-formatted formMark Rousskov-11/+10
2020-01-22Privatize private fields of OutputFilenamesMark Rousskov-2/+12
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-2/+0
2020-01-17[self-profiler] Add example to `-Z help` to turn on query key recordingWesley Wiser-1/+5
Also add the `default` option so that it's easy to add query key recording to the default.
2020-01-11feature_gate: Remove `GateStrength`Vadim Petrochenkov-37/+1
2020-01-11Rollup merge of #67806 - Centril:splitsynmore, r=petrochenkovMazdak Farrokhzad-14/+734
Extract `rustc_ast_passes`, move gating, & refactor linting Based on https://github.com/rust-lang/rust/pull/67770. This PR extracts a crate `rustc_ast_passes`: - `ast_validation.rs`, which is contributed by `rustc_passes` (now only has HIR based passes) -- the goal here is to improve recompilation of the parser, - `feature_gate.rs`, which is contributed by `syntax` and performs post-expansion-gating & final erroring for pre-expansion gating, - `show_span`, which is contributed by `syntax`. To facilitate this, we first have to also: - Move `{leveled_}feature_err{_err}` from `syntax::feature_gate::check` into `rustc_session::parse`. - Move `get_features` into `rustc_parse::config`, the only place it is used. - Move some some lint datatypes and traits, e.g. `LintBuffer`, `BufferedEarlyLint`, `BuiltinLintDiagnostics`, `LintPass`, and `LintArray` into `rustc_session::lint`. - Move all the hard-wired lint `static`s into `rustc_session::lint::builtin`.
2020-01-11pacify tidy by nixing added docs :(Mazdak Farrokhzad-12/+0
2020-01-11move {rustc -> rustc_session}::lint::builtinMazdak Farrokhzad-0/+532
2020-01-11prepare moving HardwiredLints to rustc_sessionMazdak Farrokhzad-0/+38
2020-01-11buffered lint infra -> rustc_sessionMazdak Farrokhzad-10/+84
2020-01-11document feature_err et. alMazdak Farrokhzad-0/+23
2020-01-11gating diagnostics -> rustc_session::parseMazdak Farrokhzad-4/+69
2020-01-10Auto merge of #65241 - tmiasko:no-std-san, r=alexcrichtonbors-0/+26
build-std compatible sanitizer support ### Motivation When using `-Z sanitizer=*` feature it is essential that both user code and standard library is instrumented. Otherwise the utility of sanitizer will be limited, or its use will be impractical like in the case of memory sanitizer. The recently introduced cargo feature build-std makes it possible to rebuild standard library with arbitrary rustc flags. Unfortunately, those changes alone do not make it easy to rebuild standard library with sanitizers, since runtimes are dependencies of std that have to be build in specific environment, generally not available outside rustbuild process. Additionally rebuilding them requires presence of llvm-config and compiler-rt sources. The goal of changes proposed here is to make it possible to avoid rebuilding sanitizer runtimes when rebuilding the std, thus making it possible to instrument standard library for use with sanitizer with simple, although verbose command: ``` env CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS=-Zsanitizer=thread cargo test -Zbuild-std --target x86_64-unknown-linux-gnu ``` ### Implementation * Sanitizer runtimes are no long packed into crates. Instead, libraries build from compiler-rt are used as is, after renaming them into `librusc_rt.*`. * rustc obtains runtimes from target libdir for default sysroot, so that they are not required in custom build sysroots created with build-std. * The runtimes are only linked-in into executables to address issue #64629. (in previous design it was hard to avoid linking runtimes into static libraries produced by rustc as demonstrated by sanitizer-staticlib-link test, which still passes despite changes made in #64780). cc @kennytm, @japaric, @firstyear, @choller
2020-01-09Link sanitizer runtimes instead of injecting crate dependenciesTomasz Miąsko-0/+26
2020-01-09Change -Z time event naming scheme and make them generic activitiesJohn Kåre Alsaker-4/+4
2020-01-08Remove `-Z continue-parse-after-error`Vadim Petrochenkov-2/+0
2020-01-06Improve hygiene of `newtype_index`Matthew Jasper-1/+0
Also add unit tests
2020-01-04rustc_session: allow overriding lint level of individual lints from a groupTobias Thiel-3/+10
2020-01-05Use self profile infrastructure for -Z time and -Z time-passesJohn Kåre Alsaker-11/+17
2020-01-04Auto merge of #67803 - Centril:librustc_hir, r=Zoxcbors-0/+2
Extract `rustc_hir` out of `rustc` The new crate contains: ```rust pub mod def; pub mod def_id; mod hir; pub mod hir_id; pub mod itemlikevisit; pub mod pat_util; pub mod print; mod stable_hash_impls; pub use hir::*; pub use hir_id::*; pub use stable_hash_impls::HashStableContext; ``` Remains to be done in follow-up PRs: - Move `rustc::hir::map` into `rustc_hir_map` -- this has to be a separate crate due to the `dep_graph` (blocked on https://github.com/rust-lang/rust/pull/67761). - Move references to `rustc::hir` to `rustc_hir` where possible. cc https://github.com/rust-lang/rust/issues/65031 r? @Zoxc
2020-01-04move Node{Map,Set} -> rustc_session::node_idMazdak Farrokhzad-0/+2
2020-01-03rustdoc: Respect diagnostic debugging optionsVadim Petrochenkov-15/+13
2020-01-03Introduce an option for disabling deduplication of diagnosticsVadim Petrochenkov-3/+4
2020-01-01Rename `syntax_pos` to `rustc_span` in source codeVadim Petrochenkov-17/+17
2019-12-31Rollup merge of #67735 - petrochenkov:uibool, r=Mark-SimulacrumDylan DPC-5/+11
Support `-Z ui-testing=yes/no` `ui-testing` is now a boolean option (`-Z ui-testing=yes/no`) and can be specified multiple times with later values overriding earlier values (`-Z ui-testing=yes -Z ui-testing=no` == `-Z ui-testing=no`), so it can be set in a hierarchical way, e.g. UI testing infra may enable it by default with specific tests being able to opt-out. This way we can remove the special opt-out support from `compiletest`. Inspired by https://github.com/rust-lang/rust/pull/67709.
2019-12-30Support `-Z ui-testing=yes/no`Vadim Petrochenkov-5/+11
2019-12-30Make things build againVadim Petrochenkov-1/+1
2019-12-25Remove `-Znll-dont-emit-read-for-match`Matthew Jasper-2/+0
2019-12-22Format the worldMark Rousskov-588/+416
2019-12-20Remove rarely used -Zdisable_instrumentation_preinliner flag.Michael Woerister-2/+0
The same effect can be achieved by `-Cllvm-args=-disable-preinline`.
2019-12-20Move command line option definitions into a dedicated fileVictor Ding-936/+957
config.rs has reached the 3000 line tidy limit, this commit moves command line option definitions into a new file - options.rs, and leaves the rest of configuration infrastructure in config.rs.
2019-12-17Revert "Auto merge of #67362 - Mark-Simulacrum:par-4-default, r=alexcrichton"Mark Rousskov-8/+8
This reverts commit 3ed3b8bb7b100afecf7d5f52eafbb70fec27f537, reversing changes made to 99b89533d4cdf7682ea4054ad0ee36c351d05df1. We will reland a similar patch at a future date but for now we should get a nightly released in a few hours with the parallel patch, so this should be reverted to make sure that the next nightly is not parallel-enabled.
2019-12-17Move AtomicU64 usage to AtomicUsizeMark Rousskov-3/+3
2019-12-16Change the default thread count to min(4, vCPUs)Mark Rousskov-5/+5
This avoids the problems of high thread counts (i.e., contention in the kernel on the jobserver pipe due to thundering herd of readers) while stil giving rustc some parallelism to work with.
2019-12-12Rollup merge of #67215 - nnethercote:fix-Zprint-type-size-zero-sized-fields, ↵Yuki Okushi-3/+6
r=pnkfelix Fix `-Z print-type-sizes`'s handling of zero-sized fields. Currently, the type `struct S { x: u32, y: u32, tag: () }` is incorrectly described like this: ``` print-type-size type: `S`: 8 bytes, alignment: 4 bytes print-type-size field `.x`: 4 bytes print-type-size field `.tag`: 0 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size padding: 4 bytes print-type-size field `.y`: 4 bytes, alignment: 4 bytes ``` Specifically: - The `padding` line is wrong. (There is no padding.) - The `offset` and `alignment` on the `.tag` line shouldn't be printed. The problem is that multiple fields can end up with the same offset, and the printing code doesn't handle this correctly. This commit fixes it by adjusting the field sorting so that zero-sized fields are dealt with before non-zero-sized fields. With that in place, the printing code works correctly. The commit also corrects the "something is very wrong" comment. The new output looks like this: ``` print-type-size type: `S`: 8 bytes, alignment: 4 bytes print-type-size field `.tag`: 0 bytes print-type-size field `.x`: 4 bytes print-type-size field `.y`: 4 bytes ``` r? @pnkfelix
2019-12-11Rollup merge of #67074 - ehuss:extern-options, r=petrochenkovMazdak Farrokhzad-37/+132
Add options to --extern flag. This changes the `--extern` flag so that it can take a series of options that changes its behavior. The general syntax is `[opts ':'] name ['=' path]` where `opts` is a comma separated list of options. Two options are supported, `priv` which replaces `--extern-private` and `noprelude` which avoids adding the crate to the extern prelude. ```text --extern priv:mylib=/path/to/libmylib.rlib --extern noprelude:alloc=/path/to/liballoc.rlib ``` `noprelude` is to be used by Cargo's build-std feature in order to use `--extern` to reference standard library crates. This also includes a second commit which adds the `aux-crate` directive to compiletest. I can split this off into a separate PR if desired, but it helps with defining these kinds of tests. It is based on #54020, and can be used in the future to replace and simplify some of the Makefile tests.
2019-12-11Fix `-Z print-type-sizes`'s handling of zero-sized fields.Nicholas Nethercote-3/+6
Currently, the type `struct S { x: u32, y: u32, tag: () }` is incorrectly described like this: ``` print-type-size type: `S`: 8 bytes, alignment: 4 bytes print-type-size field `.x`: 4 bytes print-type-size field `.tag`: 0 bytes, offset: 0 bytes, alignment: 1 bytes print-type-size padding: 4 bytes print-type-size field `.y`: 4 bytes, alignment: 4 bytes ``` Specifically: - The `padding` line is wrong. (There is no padding.) - The `offset` and `alignment` on the `.tag` line shouldn't be printed. The problem is that multiple fields can end up with the same offset, and the printing code doesn't handle this correctly. This commit fixes it by adjusting the field sorting so that zero-sized fields are dealt with before non-zero-sized fields. With that in place, the printing code works correctly. The commit also corrects the "something is very wrong" comment. The new output looks like this: ``` print-type-size type: `S`: 8 bytes, alignment: 4 bytes print-type-size field `.tag`: 0 bytes print-type-size field `.x`: 4 bytes print-type-size field `.y`: 4 bytes ```
2019-12-09Add options to --extern flag.Eric Huss-37/+132
2019-12-06Use `as_ref().map()` rather than `is_some().to_option()`varkor-1/+1
2019-12-06Use `to_option_with` in several placesvarkor-1/+1
2019-12-06Use `to_option` in various placesvarkor-7/+4
2019-12-03Deduplicate CrateConfigMark Rousskov-5/+4
2019-12-03Move Session to librustc_sessionMark Rousskov-0/+4741