about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
AgeCommit message (Collapse)AuthorLines
2020-12-25Auto merge of #80296 - ↵bors-1/+18
wesleywiser:revert_missing_fragment_specifier_hard_error, r=Mark-Simulacrum Revert missing fragment specifier hard error Closes #76605 Reopens #40107 r? `@Mark-Simulacrum`
2020-12-22Add some intra-doc links to compiler docsJoshua Nelson-1/+1
2020-12-22Revert "Promote missing_fragment_specifier to hard error"Wesley Wiser-1/+18
This reverts commit 02eae432e7476a0686633a8c2b7cb1d5aab1bd2c.
2020-12-17Fix testsbjorn3-3/+6
2020-12-17Move some code out of CodegenBackend::{codegen_crate,link}bjorn3-0/+14
2020-12-01Auto merge of #74967 - Aaron1011:feature/incr-def-path-table, r=pnkfelixbors-1/+1
Implement lazy decoding of DefPathTable during incremental compilation PR https://github.com/rust-lang/rust/pull/75813 implemented lazy decoding of the `DefPathTable` from crate metadata. However, it requires decoding the entire `DefPathTable` when incremental compilation is active, so that we can map a decoded `DefPathHash` to a `DefId` from an arbitrary crate. This PR adds support for lazy decoding of dependency `DefPathTable`s when incremental compilation si active. When we load the incremental cache and dep graph, we need the ability to map a `DefPathHash` to a `DefId` in the current compilation session (if the corresponding definition still exists). This is accomplished by storing the old `DefId` (that is, the `DefId` from the previous compilation session) for each `DefPathHash` we need to remap. Since a `DefPathHash` includes the owning crate, the old crate is guaranteed to be the right one (if the definition still exists). We then use the old `DefIndex` as an initial guess, which we validate by comparing the expected and actual `DefPathHash`es. In most cases, foreign crates will be completely unchanged, which means that we our guess will be correct. If our guess is wrong, we fall back to decoding the entire `DefPathTable` for the foreign crate. This still represents an improvement over the status quo, since we can skip decoding the entire `DefPathTable` for other crates (where all of our guesses were correct).
2020-11-25Lazy DefPath decoding for incremental compilationAaron Hill-1/+1
2020-11-25Validate use of parameters in naked functionsTomasz Miąsko-0/+1
* Reject use of parameters inside naked function body. * Reject use of patterns inside function parameters, to emphasize role of parameters a signature declaration (mirroring existing behaviour for function declarations) and avoid generating code introducing specified bindings.
2020-11-19Move `rustc_ty` -> `rustc_ty_utils`LeSeulArtichaut-1/+1
2020-11-15Rollup merge of #79036 - cjgillot:steal, r=oli-obkJonas Schievink-1/+1
Move Steal to rustc_data_structures.
2020-11-14Move Steal to rustc_data_structures.Camille GILLOT-1/+1
2020-11-13cleanup: Remove `ParseSess::injected_crate_name`Vadim Petrochenkov-6/+2
2020-11-02Rollup merge of #78610 - petrochenkov:nostriptok, r=Aaron1011Yuki Okushi-88/+2
Do not remove tokens before AST json serialization `TokenStripper` is error-prone and introduces one more use of `MutVisitor`. It's much simpler to treat serialization as just one more place that wants lazy token stream to turn into a real token stream. Also, no code is better than more code, in general. r? @Aaron1011 (I also merged tests for `TokenStripper` ICEs into one.)
2020-11-01Auto merge of #75534 - Aaron1011:feature/new-future-breakage, r=pnkfelixbors-1/+4
Implement rustc side of report-future-incompat cc https://github.com/rust-lang/rust/issues/71249 This is an alternative to `@pnkfelix's` initial implementation in https://github.com/pnkfelix/rust/commits/prototype-rustc-side-of-report-future-incompat (mainly because I started working before seeing that branch :smile: ). My approach outputs the entire original `Diagnostic`, in a way that is compatible with incremental compilation. This is not yet integrated with compiletest, but can be used manually by passing `-Z emit-future-incompat-report` to `rustc`. Several changes are made to support this feature: * The `librustc_session/lint` module is moved to a new crate `librustc_lint_defs` (name bikesheddable). This allows accessing lint definitions from `librustc_errors`. * The `Lint` struct is extended with an `Option<FutureBreakage>`. When present, it indicates that we should display a lint in the future-compat report. `FutureBreakage` contains additional information that we may want to display in the report (currently, a `date` field indicating when the crate will stop compiling). * A new variant `rustc_error::Level::Allow` is added. This is used when constructing a diagnostic for a future-breakage lint that is marked as allowed (via `#[allow]` or `--cap-lints`). This allows us to capture any future-breakage diagnostics in one place, while still discarding them before they are passed to the `Emitter`. * `DiagnosticId::Lint` is extended with a `has_future_breakage` field, indicating whether or not the `Lint` has future breakage information (and should therefore show up in the report). * `Session` is given access to the `LintStore` via a new `SessionLintStore` trait (since `librustc_session` cannot directly reference `LintStore` without a cyclic dependency). We use this to turn a string `DiagnosticId::Lint` back into a `Lint`, to retrieve the `FutureBreakage` data. Currently, `FutureBreakage.date` is always set to `None`. However, this could potentially be interpreted by Cargo in the future. I've enabled the future-breakage report for the `ARRAY_INTO_ITER` lint, which can be used to test out this PR. The intent is to use the field to allow Cargo to determine the date of future breakage (as described in [RFC 2834](https://github.com/rust-lang/rfcs/blob/master/text/2834-cargo-report-future-incompat.md)) without needing to parse the diagnostic itself. cc `@pnkfelix`
2020-11-01Do not remove tokens before AST json serializationVadim Petrochenkov-88/+2
2020-10-30Implement rustc side of report-future-incompatAaron Hill-1/+4
2020-10-29Strip tokens from trait and impl items before printing AST JSONAaron Hill-0/+11
Fixes #78510
2020-10-26Remove tokens from foreign items in `TokenStripper`Aaron Hill-0/+7
Fixes #78398 I forgot to handle this case in #77255
2020-10-21Strip tokens before printing AST JSONAaron Hill-2/+70
2020-10-05Add -Z codegen-backend dylib to depskhyperia-0/+4
When the codegen-backend dylib changes, the program should be rebuilt.
2020-09-01interface: use `OnceCell` from standard librarymarmeladema-3/+3
2020-08-30Add `-Z proc-macro-backtrace` to allow showing proc-macro panicsAaron Hill-0/+1
Fixes #75050 Previously, we would unconditionally suppress the panic hook during proc-macro execution. This commit adds a new flag -Z proc-macro-backtrace, which allows running the panic hook for easier debugging.
2020-08-30mv compiler to compiler/mark-0/+1004