| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
It has a single call site and removing it makes the code simpler.
Perhaps there were more uses at some point in the past?
|
|
The same comments are on the `DepNodeExt` trait and the single impl of
that trait, immediately below. This commit eliminates the duplication.
|
|
`rustc_middle` and `rustc_query_system` both have a file called
`dep_node.rs` with a big comment at the top, and the comments are very
similar. The one in `rustc_query_system` looks like the original, and
the one in `rustc_middle` is a copy with some improvements.
This commit removes the comment from `rustc_middle` and updates the one
in `rustc_query_system` to include the improvements. I did it this way
because `rustc_query_system` is the crate that defines `DepNode`, and so
seems like the right place for the comment.
|
|
`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.
|
|
|
|
I am surprised the diff is so small for this enormous crate.
|
|
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
|
|
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
|
|
Simplifies the API a bit.
|
|
|
|
|
|
|
|
|
|
Add `{Local}ModDefId` to more strongly type DefIds`
Based on #110862 by `@Nilstrieb`
|
|
Constructing an FxIndexMap is useless work as the iteration order never
matters.
|
|
This allows for better type safety in the compiler and also improves the
documentation for many things, making it clear that they expect modules.
|
|
Removes a piece of mutable state.
Follow up to #114578.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This allows removing a function from the `DepKind` trait.
|
|
|
|
|
|
|
|
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)`
|
|
This reverts commit 2cb9a65684dba47c52de8fa938febf97a73e70a9, reversing
changes made to 750bd1a7ff3e010611b97ee75d30b7cbf5f3a03c.
|
|
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`
|
|
|
|
We can avoid these by adding slightly more information to `rustc_query_append` instead.
|
|
|
|
- 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`.
|
|
- 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
|
|
- 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`
|
|
It's not actually necessary and it makes the code harder to read.
|
|
|
|
|
|
|
|
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
|