about summary refs log tree commit diff
path: root/compiler/rustc_interface/src/passes.rs
AgeCommit message (Collapse)AuthorLines
2021-10-05Auto merge of #89266 - cjgillot:session-ich, r=michaelwoeristerbors-1/+1
Move ICH to rustc_query_system Based on https://github.com/rust-lang/rust/pull/89183 The StableHashingContext does not need to be in rustc_middle. This PR moves it to rustc_query_system. This will avoid a dependency between rustc_ast_lowering and rustc_middle in https://github.com/rust-lang/rust/pull/89124.
2021-10-03Fix ICE with buffered lint referring to AST node deleted by everybody_loopsFabian Wolff-6/+12
2021-10-03Move rustc_middle::middle::cstore to rustc_session.Camille GILLOT-1/+1
2021-10-02Auto merge of #89405 - GuillaumeGomez:fix-clippy-lints, r=cjgillotbors-15/+15
Fix clippy lints I'm currently working on allowing clippy to run on librustdoc after a discussion I had with `@Mark-Simulacrum.` So in the meantime, I fixed a few lints on the compiler crates.
2021-10-01Fix clippy lintsGuillaume Gomez-15/+15
2021-10-01Auto merge of #88880 - cjgillot:no-krate, r=oli-obkbors-5/+3
Rework HIR API to make invocations of the hir_crate query harder. `hir_crate` forces the recomputation of queries that depend on it. This PR aims at avoiding useless invocations of `hir_crate` by making dependent code go through `tcx.hir()`.
2021-09-30Move EncodedMetadata to rustc_metadata.Camille GILLOT-5/+4
2021-09-30Move encode_metadata out of CrateStore.Camille GILLOT-1/+2
2021-09-29Move body_owners to tcx.hir().Camille GILLOT-5/+3
2021-09-28rustc_session: Remove lint store from `Session`Vadim Petrochenkov-4/+1
2021-09-27Auto merge of #89214 - smoelius:register_tool, r=petrochenkovbors-2/+6
Pass real crate-level attributes to `pre_expansion_lint` The PR concerns the unstable feature `register_tool` (#66079). The feature's implementation requires the attributes of the crate being compiled, so that when attributes like `allow(foo::bar)` are encountered, it can be verified that `register_tool(foo)` appears in the crate root. However, the crate's attributes are not readily available during early lint passes. Specifically, on this line, `krate.attrs` appears to be the attributes of the current source file, not the attributes of the whole crate: https://github.com/rust-lang/rust/blob/bf642323d621dcefeef1d8ab4711aae36e357615/compiler/rustc_lint/src/context.rs#L815 Consequently, "unknown tool" errors were being produced when `allow(foo::bar)` appeared in a submodule, even though `register_tool(foo)` appeared in the crate root. EDITED: The proposed fix is to obtain the real crate-level attributes in `configure_and_expand` and pass them to `pre_expansion_lint`. (See `@petrochenkov's` [comment](https://github.com/rust-lang/rust/pull/89214#issuecomment-926927072) below.) The original "prosed fix" text follows. --- The proposed fix is to add an `error_on_unknown_tool` flag to `LintLevelsBuilder`. The flag controls whether "unknown tool" errors are emitted. The flag is set during late passes, but not earlier. More specifically, this PR contains two commits: * The first adds a `known-tool-in-submodule` UI test that does not currently pass. * The second adds the `error_on_unknown_tool` flag. The new test passes with the addition of this flag. This change has the added benefit of eliminating some errors that were duplicated in existing tests. To the reviewer: please check that I implemented the UI test correctly.
2021-09-26Pass real crate-level attributes to `pre_expansion_lint`Samuel Moelius-2/+6
2021-09-25Check for macros in built-in attributes that don't support them.Eric Huss-5/+25
2021-09-12Gather module items after lowering.Camille GILLOT-4/+4
2021-09-07Rename rustc_mir to rustc_const_eval.Camille GILLOT-2/+1
2021-09-07Move monomorphize code to its own crate.Camille GILLOT-0/+1
2021-09-07Move rustc_mir::transform to rustc_mir_transform.Camille GILLOT-2/+3
2021-09-07Move rustc_mir::borrow_check to new crate rustc_borrowck.Camille GILLOT-0/+2
2021-09-05Auto merge of #88435 - cjgillot:no-walk-crate, r=Aaron1011bors-4/+0
Avoid invoking the hir_crate query to traverse the HIR Walking the HIR tree is done using the `hir_crate` query. However, this is unnecessary, since `hir_owner(CRATE_DEF_ID)` provides the same information. Since depending on `hir_crate` forces dependents to always be executed, this leads to unnecessary work. By splitting HIR and attributes visits, we can avoid an edge to `hir_crate` when trying to visit the HIR tree.
2021-09-02Drop walk_crate_and_attributes.Camille GILLOT-4/+0
2021-09-01Compute proc_macros in resolutions.Camille GILLOT-1/+1
2021-08-10Replace #[plugin_registrar] with exporting __rustc_plugin_registrarbjorn3-3/+0
2021-07-18Move OnDiskCache to rustc_query_impl.Camille GILLOT-3/+5
2021-07-14Shrink the CrateStore dynamic interface.Camille GILLOT-6/+2
2021-07-06Revert "Revert "Merge CrateDisambiguator into StableCrateId""bjorn3-4/+8
This reverts commit 8176ab8bc18fdd7d3c2cf7f720c51166364c33a3.
2021-07-04Combine individual limit queries into single `limits` queryAaron Hill-7/+5
2021-07-04Query-ify global limit attribute handlingAaron Hill-5/+12
2021-07-02add track_path::path fn for proc-macro usageBernhard Schuster-3/+13
Ref #73921
2021-06-30Update comments.Camille GILLOT-12/+5
2021-06-30Fix AST pretty.Camille GILLOT-3/+3
2021-06-30Move AST crate.Camille GILLOT-6/+8
2021-06-30Arena-allocate Crate during lowering.Camille GILLOT-2/+1
2021-06-30Move lowering to create_global_ctxt.Camille GILLOT-10/+14
2021-06-30Inline lower_to_hir.Camille GILLOT-0/+1
2021-06-30Separate resolver creation from expansion.Camille GILLOT-49/+29
2021-06-23Use HTTPS links where possibleSmitty-1/+1
2021-06-11Auto merge of #85885 - bjorn3:remove_box_region, r=cjgillotbors-38/+87
Don't use a generator for BoxedResolver The generator is non-trivial and requires unsafe code anyway. Using regular unsafe code without a generator is much easier to follow. Based on #85810 as it touches rustc_interface too.
2021-06-10Remove unnecessary transmutebjorn3-2/+1
2021-06-09Add safety commentsbjorn3-0/+5
2021-06-09Use explicit drop implbjorn3-8/+13
2021-06-08Do not require the DefPathTable to construct the on-disk cache.Camille GILLOT-3/+1
2021-06-08Don't require LintStore to live for 'a in configure_and_expand_innerbjorn3-1/+1
2021-06-08Revert "Let several methods take &Resolver instead of a BoxedResolver wrapper"bjorn3-15/+18
This reverts commit 5343ec338f72a61e2f51f9d90117092c8e8a725a.
2021-06-08Use a submodule as safety boundary for BoxedResolverbjorn3-55/+60
2021-06-08Don't use a generator for BoxedResolverbjorn3-117/+48
The generator is non-trivial and requires unsafe code anyway. Using regular unsafe code without a generator is much easier to follow.
2021-06-08Don't return a BoxedResolver on errorsbjorn3-5/+4
2021-06-08Inline two more methodsbjorn3-24/+14
2021-06-08Let several methods take &Resolver instead of a BoxedResolver wrapperbjorn3-18/+15
2021-06-08Store boxed metadata loader in CrateLoaderbjorn3-2/+2
2021-06-08Replace Pin::new with .as_mut()bjorn3-3/+5