about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/dep_graph
AgeCommit message (Collapse)AuthorLines
2024-12-18Re-export more `rustc_span::symbol` things from `rustc_span`.Nicholas Nethercote-1/+1
`rustc_span::symbol` defines some things that are re-exported from `rustc_span`, such as `Symbol` and `sym`. But it doesn't re-export some closely related things such as `Ident` and `kw`. So you can do `use rustc_span::{Symbol, sym}` but you have to do `use rustc_span::symbol::{Ident, kw}`, which is inconsistent for no good reason. This commit re-exports `Ident`, `kw`, and `MacroRulesNormalizedIdent`, and changes many `rustc_span::symbol::` qualifiers in `compiler/` to `rustc_span::`. This is a 200+ net line of code reduction, mostly because many files with two `use rustc_span` items can be reduced to one.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-5/+5
2024-08-29Add `warn(unreachable_pub)` to `rustc_middle`.Nicholas Nethercote-2/+3
I am surprised the diff is so small for this enormous crate.
2024-07-29Reformat `use` declarations.Nicholas Nethercote-13/+11
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-19local_def_path_hash_to_def_id can failMichael Baikov-10/+2
local_def_path_hash_to_def_id is used by Debug impl for DepNode and it looks for DefPathHash inside the current compilation. During incremental compilation we are going through nodes that belong to a previous compilation and might not be present and a simple attempt to print such node with tracing::debug (try_mark_parent_green does it for example) results in a otherwise avoidable panic Panic was added in https://github.com/rust-lang/rust/pull/82183, specifically in 2b60338ee9, with a comment "We only use this mapping for cases where we know that it must succeed.", but I'm not sure if this property holds when we traverse nodes from the old compilation in order to figure out if they are valid or not
2024-03-27Use a `dyn Debug` trait object instead of a closure.Oli Scherer-6/+8
Simplifies the API a bit.
2023-11-16Reduce exposure of things.Nicholas Nethercote-2/+2
2023-09-21Move `DepKind` to `rustc_query_system` and define it as `u16`John Kåre Alsaker-104/+39
2023-09-04Use a specialized varint + bitpacking scheme for DepGraph encodingBen Kimock-1/+17
2023-09-03Encode DepKind as u16Ben Kimock-1/+47
2023-08-15Rollup merge of #114772 - fee1-dead-contrib:typed-did, r=b-naberGuillaume Gomez-1/+51
Add `{Local}ModDefId` to more strongly type DefIds` Based on #110862 by `@Nilstrieb`
2023-08-13Pass WorkProductMap to build_dep_graph instead of FxIndexMapbjorn3-1/+1
Constructing an FxIndexMap is useless work as the iteration order never matters.
2023-08-13Add typed `{Local}DefId` for modulesNilstrieb-1/+51
This allows for better type safety in the compiler and also improves the documentation for many things, making it clear that they expect modules.
2023-08-09rustc: Move `stable_crate_id` from `Session` to `GlobalCtxt`Vadim Petrochenkov-2/+2
Removes a piece of mutable state. Follow up to #114578.
2023-07-30inline format!() args up to and including rustc_middleMatthias Krüger-2/+2
2023-04-21Allow `LocalDefId` as the argument to `def_path_str`Oli Scherer-1/+1
2023-04-18Store hashes in special types so they aren't accidentally encoded as numbersBen Kimock-2/+3
2023-04-03Hide warning.Camille GILLOT-2/+2
2023-02-14Pass `DepContext` and `QueryContext` by value when practicalJohn Kåre Alsaker-2/+2
2023-02-09Simplify `tls::enter_context`.Nicholas Nethercote-1/+1
2022-12-20rustc: Remove needless lifetimesJeremy Stucki-1/+1
2022-10-01Allow query system to recover a HirId.Camille GILLOT-6/+32
2022-09-25Move the `codegen_unit` debug assert from `rustc_query_system` to `query_impl`Joshua Nelson-4/+0
This allows removing a function from the `DepKind` trait.
2022-09-25Move some more code from rustc_middle to rustc_query_systemJoshua Nelson-14/+1
2022-09-25Move functions on `DepKindStruct` from rustc_middle to rustc_query_systemJoshua Nelson-60/+10
2022-09-25Move `DepKindStruct` from rustc_middle to rustc_query_systemJoshua Nelson-62/+3
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-1/+23
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-09-22Revert "Auto merge of #101620 - cjgillot:compute_lint_levels_by_def, r=oli-obk"Camille GILLOT-32/+6
This reverts commit 2cb9a65684dba47c52de8fa938febf97a73e70a9, reversing changes made to 750bd1a7ff3e010611b97ee75d30b7cbf5f3a03c.
2022-09-15Auto merge of #101173 - jyn514:simplify-macro-arguments, r=cjgillotbors-22/+13
Further simplify the macros generated by `rustc_queries` This doesn't actually move anything outside the macros, but it makes them simpler to read. - Add a new `rustc_query_names` macro. This allows a much simpler syntax for the matchers in the macros passed to it as a callback. - Convert `define_dep_nodes` and `alloc_once` to use `rustc_query_names`. This is possible because they only use the names (despite the quite complicated matchers in `define_dep_nodes`, none of the other arguments are used). - Get rid of `rustc_dep_node_append`. r? `@cjgillot`
2022-09-14Allow query system to recover a HirId.Camille GILLOT-6/+32
2022-09-06Get rid of the emitted `rustc_query_names` and `rustc_cached_queries` macroJoshua Nelson-9/+10
We can avoid these by adding slightly more information to `rustc_query_append` instead.
2022-09-06Support doc-comments in `define_dep_nodes`Joshua Nelson-4/+4
2022-09-06Further simplify the macros generated by `rustc_queries`Joshua Nelson-17/+7
- Add a new `rustc_query_names` macro. This allows a much simpler syntax for the matchers in the macros passed to it as a callback. - Convert `define_dep_nodes` and `alloc_once` to use `rustc_query_names`. This is possible because they only use the names (despite the quite complicated matchers in `define_dep_nodes`, none of the other arguments are used). - Get rid of `rustc_dep_node_append`.
2022-09-01Don't create two new closures for each queryJoshua Nelson-3/+3
- Parameterize DepKindStruct over `'tcx` This allows passing in an invariant function pointer in `query_callback`, rather than having to try and make it work for any lifetime. - Add a new `execute_query` function to `QueryDescription` so we can call `tcx.$name` without needing to be in a macro context
2022-08-24Simplify the syntax for macros generated by `rustc_queries`Joshua Nelson-1/+1
- Disallow multiple macros callbacks in the same invocation. In practice, this was never used. - Remove the `[]` brackets around the macro name - Require an `ident`, not an arbitrary `tt`
2022-08-23Remove `$tcx` metavariable from `rustc_query_append`Joshua Nelson-2/+2
It's not actually necessary and it makes the code harder to read.
2022-07-06Use a dedicated DepKind for the forever-red node.Camille GILLOT-0/+4
2022-07-06Allow to create definitions inside the query system.Camille GILLOT-2/+2
2022-05-20Remove `crate` visibility usage in compilerJacob Pratt-3/+6
2022-04-17Stop using CRATE_DEF_INDEX.Camille GILLOT-2/+2
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
2022-02-16Adopt let_else in even more placesest31-1/+1
2022-01-19Show a more informative panic message when `DefPathHash` does not existAaron Hill-1/+3
This should hopefully make it easier to debug incremental compilation bugs like #93096 without affecting performance.
2022-01-08Introduce new `TaskDepsRef` enum to track allow/ignore/forbid statusAaron Hill-3/+3
2021-12-15Remove `in_band_lifetimes` from `rustc_middle`Aaron Hill-2/+2
See #91867 This was mostly straightforward. In several places, I take advantage of the fact that lifetimes are non-hygenic: a macro declares the 'tcx' lifetime, which is then used in types passed in as macro arguments.
2021-10-20Address review.Camille GILLOT-7/+0
2021-10-20Inline DepNodeParams methods.Camille GILLOT-0/+14
2021-10-20Build jump table at runtime.Camille GILLOT-10/+16
2021-10-20Invoke callbacks from rustc_middle.Camille GILLOT-0/+30
2021-10-20Merge two query callbacks arrays.Camille GILLOT-125/+83
2021-10-20Drop has_params.Camille GILLOT-35/+2