diff options
| author | bors <bors@rust-lang.org> | 2025-01-27 23:20:59 +0000 | 
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-01-27 23:20:59 +0000 | 
| commit | e71f9a9a98b0faf423844bf0ba7438f29dc27d58 (patch) | |
| tree | 9c54152146c4d35ca34ee55abc5e6d59ae1d81a6 /compiler/rustc_query_system/src | |
| parent | 9fc6b43126469e3858e2fe86cafb4f0fd5068869 (diff) | |
| parent | 690f433e3e561ab79a7e9b1bc675b0109592dde6 (diff) | |
| download | rust-1.84.1.tar.gz rust-1.84.1.zip | |
Auto merge of #136158 - cuviper:stable-next, r=cuviper 1.84.1
[stable] Prepare Rust 1.84.1 point release - [Fix ICE 132920 in duplicate-crate diagnostics.](https://github.com/rust-lang/rust/pull/133304/) - [Fix errors for overlapping impls in incremental rebuilds.](https://github.com/rust-lang/rust/pull/133828/) - [Fix slow compilation related to the next-generation trait solver.](https://github.com/rust-lang/rust/pull/135618/) - [Fix debuginfo when LLVM's location discriminator value limit is exceeded.](https://github.com/rust-lang/rust/pull/135643/) - Fixes for building Rust from source: - [Only try to distribute `llvm-objcopy` if llvm tools are enabled.](https://github.com/rust-lang/rust/pull/134240/) - [Add Profile Override for Non-Git Sources.](https://github.com/rust-lang/rust/pull/135433/) - [Resolve symlinks of LLVM tool binaries before copying them.](https://github.com/rust-lang/rust/pull/135585/) - [Make it possible to use ci-rustc on tarball sources.](https://github.com/rust-lang/rust/pull/135722/) cc `@rust-lang/release` r? ghost
Diffstat (limited to 'compiler/rustc_query_system/src')
| -rw-r--r-- | compiler/rustc_query_system/src/dep_graph/graph.rs | 17 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/query/plumbing.rs | 8 | 
2 files changed, 20 insertions, 5 deletions
| diff --git a/compiler/rustc_query_system/src/dep_graph/graph.rs b/compiler/rustc_query_system/src/dep_graph/graph.rs index 9b26a5bbcc6..4b47ce8389c 100644 --- a/compiler/rustc_query_system/src/dep_graph/graph.rs +++ b/compiler/rustc_query_system/src/dep_graph/graph.rs @@ -302,7 +302,11 @@ impl<D: Deps> DepGraph<D> { OP: FnOnce() -> R, { match self.data() { - Some(data) => data.with_anon_task(cx, dep_kind, op), + Some(data) => { + let (result, index) = data.with_anon_task_inner(cx, dep_kind, op); + self.read_index(index); + (result, index) + } None => (op(), self.next_virtual_depnode_index()), } } @@ -397,7 +401,16 @@ impl<D: Deps> DepGraphData<D> { /// Executes something within an "anonymous" task, that is, a task the /// `DepNode` of which is determined by the list of inputs it read from. - pub(crate) fn with_anon_task<Tcx: DepContext<Deps = D>, OP, R>( + /// + /// NOTE: this does not actually count as a read of the DepNode here. + /// Using the result of this task without reading the DepNode will result + /// in untracked dependencies which may lead to ICEs as nodes are + /// incorrectly marked green. + /// + /// FIXME: This could perhaps return a `WithDepNode` to ensure that the + /// user of this function actually performs the read; we'll have to see + /// how to make that work with `anon` in `execute_job_incr`, though. + pub(crate) fn with_anon_task_inner<Tcx: DepContext<Deps = D>, OP, R>( &self, cx: Tcx, dep_kind: DepKind, diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs index aac8ab87c64..6fb5e37d2d0 100644 --- a/compiler/rustc_query_system/src/query/plumbing.rs +++ b/compiler/rustc_query_system/src/query/plumbing.rs @@ -520,9 +520,11 @@ where let (result, dep_node_index) = qcx.start_query(job_id, query.depth_limit(), Some(&diagnostics), || { if query.anon() { - return dep_graph_data.with_anon_task(*qcx.dep_context(), query.dep_kind(), || { - query.compute(qcx, key) - }); + return dep_graph_data.with_anon_task_inner( + *qcx.dep_context(), + query.dep_kind(), + || query.compute(qcx, key), + ); } // `to_dep_node` is expensive for some `DepKind`s. | 
