about summary refs log tree commit diff
path: root/compiler/rustc_query_system
AgeCommit message (Collapse)AuthorLines
2025-03-24Remove `QueryWaiter::notify`John Kåre Alsaker-8/+2
2025-03-24Batch mark waiters as unblocked when resuming in the deadlock handlerJohn Kåre Alsaker-2/+8
2025-03-24Revert "resume one waiter at a call"John Kåre Alsaker-15/+2
This reverts commit cc1e4ede9388d87750c3751f41e8c6c4f6cae995.
2025-03-21Address commentsJohn Kåre Alsaker-4/+8
2025-03-21Use hashbrown from crates.ioJohn Kåre Alsaker-2/+5
2025-03-21Optimize hash map operations in the query systemJohn Kåre Alsaker-29/+43
2025-03-21Update commentsJohn Kåre Alsaker-0/+3
2025-03-21Abort in deadlock handler if we fail to get a query mapJohn Kåre Alsaker-4/+5
2025-03-20Use `-Wunused_crate_dependencies` for compiler crates.Nicholas Nethercote-1/+0
It's very useful. There are some false positives involving integration tests in `rustc_pattern_analysis` and `rustc_serialize`. There is also a false positive involving `rustc_driver_impl`'s `rustc_randomized_layouts` feature. And I removed a `rustc_span` mention in a doc comment in `rustc_log` because it wasn't integral to the comment but caused a dev-dependency.
2025-03-19Allow duplicates for side effect nodesJohn Kåre Alsaker-2/+5
2025-03-19Pass in dep kind names to the duplicate dep node checkJohn Kåre Alsaker-4/+7
2025-03-19Rename `intern_new_node` to `alloc_new_node`John Kåre Alsaker-4/+4
2025-03-19Use `ShardedHashMap` for `anon_node_to_index`John Kåre Alsaker-28/+9
2025-03-19Use `nodes_newly_allocated_in_current_session` to lookup forbidden readsJohn Kåre Alsaker-5/+18
2025-03-19Check for duplicate dep nodes when creating the indexJohn Kåre Alsaker-1/+8
2025-03-19Add fixmeJohn Kåre Alsaker-0/+1
2025-03-19Outline some cold code and turn on hash collision detection with ↵John Kåre Alsaker-16/+21
debug_assertions
2025-03-19Only use the new node hashmap for anonymous nodes.Camille GILLOT-48/+101
2025-03-15Fix `record_diagnostic`John Kåre Alsaker-2/+6
2025-03-14Add commentsJohn Kåre Alsaker-0/+9
2025-03-14Rename `QuerySideEffects` to `QuerySideEffect`John Kåre Alsaker-17/+25
2025-03-14Represent diagnostic side effects as dep nodesJohn Kåre Alsaker-120/+107
2025-03-12Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, ↵Matthias Krüger-1/+0
r=onur-ozkan,jieyouxu Use `RUSTC_LINT_FLAGS` more An alternative to the failed #138084. Fixes #138106. r? ````@jieyouxu````
2025-03-11Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-10Convert `ShardedHashMap` to use `hashbrown::HashTable`Josh Stone-31/+15
The `hash_raw_entry` feature has finished fcp-close, so the compiler should stop using it to allow its removal. Several `Sharded` maps were using raw entries to avoid re-hashing between shard and map lookup, and we can do that with `hashbrown::HashTable` instead.
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-3/+1
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). This breakage was reported in <https://github.com/rust-lang/rust/issues/138304>. This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-09Auto merge of #138267 - matthiaskrgr:rollup-vt76bhs, r=matthiaskrgrbors-7/+8
Rollup of 12 pull requests Successful merges: - #136127 (Allow `*const W<dyn A> -> *const dyn A` ptr cast) - #136968 (Turn order dependent trait objects future incompat warning into a hard error) - #137319 (Stabilize `const_vec_string_slice`) - #137885 (tidy: add triagebot checks) - #138040 (compiler: Use `size_of` from the prelude instead of imported) - #138084 (Use workspace lints for crates in `compiler/`) - #138158 (Move more layouting logic to `rustc_abi`) - #138160 (depend more on attr_data_structures and move find_attr! there) - #138192 (crashes: couple more tests) - #138216 (bootstrap: Fix stack printing when a step cycle is detected) - #138232 (Reduce verbosity of GCC build log) - #138242 (Revert "Don't test new error messages with the stage 0 compiler") r? `@ghost` `@rustbot` modify labels: rollup
2025-03-09Rollup merge of #138084 - nnethercote:workspace-lints, r=jieyouxuMatthias Krüger-1/+3
Use workspace lints for crates in `compiler/` This is nicer and hopefully less error prone than specifying lints via bootstrap. r? ``@jieyouxu``
2025-03-09Rollup merge of #138040 - thaliaarchi:use-prelude-size-of.compiler, ↵Matthias Krüger-6/+5
r=compiler-errors compiler: Use `size_of` from the prelude instead of imported Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. Apply this change across the compiler. These functions were added to all preludes in Rust 1.80. r? ``@compiler-errors``
2025-03-09Auto merge of #137563 - FractalFir:dep_graph_cap, r=nnethercotebors-2/+1
Change TaskDeps to start preallocated with 128 capacity This is a tiny change that makes `TaskDeps::read_set` start preallocated with capacity for 128 elements. From local profiling, it looks like `TaskDeps::read_set` is one of the most-often resized hash-sets in `rustc`.
2025-03-08Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
(Except for `rustc_codegen_cranelift`.) It's no longer necessary now that `unreachable_pub` is in the workspace lints.
2025-03-08Specify rust lints for `compiler/` crates via Cargo.Nicholas Nethercote-0/+3
By naming them in `[workspace.lints.rust]` in the top-level `Cargo.toml`, and then making all `compiler/` crates inherit them with `[lints] workspace = true`. (I omitted `rustc_codegen_{cranelift,gcc}`, because they're a bit different.) The advantages of this over the current approach: - It uses a standard Cargo feature, rather than special handling in bootstrap. So, easier to understand, and less likely to get accidentally broken in the future. - It works for proc macro crates. It's a shame it doesn't work for rustc-specific lints, as the comments explain.
2025-03-07compiler: Use size_of from the prelude instead of importedThalia Archibald-6/+5
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
2025-03-05Rollup merge of #137731 - SparrowLii:waiter, r=nnethercote许杰友 Jieyou Xu (Joe)-2/+15
Resume one waiter at once in deadlock handler When multiple query loop errors occur in the code, only one waiter should be resumed at a time to avoid waking up multiple waiters at the same time and causing deadlock due to thread grabbing. This fixes the UI failures in #132051 cc `@Zoxc` `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol` Zulip discussion [here](https://rust-lang.zulipchat.com/#narrow/channel/187679-t-compiler.2Fwg-parallel-rustc/topic/Deadlocks.20and.20Rayon) Edit: We can't reproduce these bugs with the existing test suits, so we keep them until we merge #132051 UPDATES #129912 UPDATES #120757 UPDATES #129911
2025-03-05resume one waiter at a callroot-2/+15
2025-03-03Remove some unnecessary aliases from `rustc_data_structures::sync`Zalathar-1/+1
With the removal of `cfg(parallel_compiler)`, these are always shared references and `std::sync::OnceLock`.
2025-02-27Changed the dependency graph to start preallocated with 128 capacityMichał Kostrubiec-2/+1
2025-02-24Introduce new parsing infrastructure and types for parsed attributesJana Dönszelmann-14/+6
fixup docs in parser
2025-02-22Greatly simplify lifetime captures in edition 2024Michael Goulet-1/+1
2025-02-22Upgrade the compiler to edition 2024Michael Goulet-1/+1
2025-02-16Move hashes from rustc_data_structure to rustc_hashes so they can be shared ↵Ben Kimock-1/+2
with rust-analyzer
2025-02-13Rollup merge of #136858 - safinaskar:parallel-cleanup-2025-02-11-07-54, ↵Jacob Pratt-2/+2
r=SparrowLii Parallel-compiler-related cleanup Parallel-compiler-related cleanup I carefully split changes into commits. Commit messages are self-explanatory. Squashing is not recommended. cc "Parallel Rustc Front-end" https://github.com/rust-lang/rust/issues/113349 r? SparrowLii ``@rustbot`` label: +WG-compiler-parallel
2025-02-11compiler: remove rustc_target reexport of rustc_abi::HashStableContextJubilee Young-2/+2
The last public reexport of rustc_abi in rustc_target is finally gone.
2025-02-11compiler/rustc_data_structures/src/sync.rs: remove atomics, but not AtomicU64!Askar Safin-2/+2
2025-02-06Auto merge of #136471 - safinaskar:parallel, r=SparrowLiibors-8/+9
tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc` tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc` This is continuation of https://github.com/rust-lang/rust/pull/132282 . I'm pretty sure I did everything right. In particular, I searched all occurrences of `Lrc` in submodules and made sure that they don't need replacement. There are other possibilities, through. We can define `enum Lrc<T> { Rc(Rc<T>), Arc(Arc<T>) }`. Or we can make `Lrc` a union and on every clone we can read from special thread-local variable. Or we can add a generic parameter to `Lrc` and, yes, this parameter will be everywhere across all codebase. So, if you think we should take some alternative approach, then don't merge this PR. But if it is decided to stick with `Arc`, then, please, merge. cc "Parallel Rustc Front-end" ( https://github.com/rust-lang/rust/issues/113349 ) r? SparrowLii `@rustbot` label WG-compiler-parallel
2025-02-04Rollup merge of #136465 - nnethercote:rustc_middle-MORE, r=jieyouxuJacob Pratt-13/+26
Some `rustc_middle` cleanups Small cleanups I found while looking closely at this code. r? `@jieyouxu`
2025-02-04Remove `dep_node` comment duplication.Nicholas Nethercote-13/+26
`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.
2025-02-03Notes on types/traits used for in-memory query cachingZalathar-5/+23
When the word "cache" appears in the context of the query system, it often isn't obvious whether that is referring to the in-memory query cache or the on-disk incremental cache. For these types, we can assure the reader that they are for in-memory caching.
2025-02-03tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`Askar Safin-8/+9
2025-01-16Properly note when query stack is being cut offMichael Goulet-3/+3