Use closures more consistently in dep_graph.rs.#153997
Use closures more consistently in dep_graph.rs.#153997rust-bors[bot] merged 1 commit intorust-lang:mainfrom
dep_graph.rs.#153997Conversation
|
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 Some changes occurred in compiler/rustc_codegen_gcc |
|
|
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Use closures more consistently in `dep_graph.rs`.
|
Based on comments, I think there was historically a desire to make sure that dep-graph tasks didn't accidentally pull in other untracked state via closure capture. But given the existing inconsistency, and the fact that passing |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (283c322): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary -1.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeResults (secondary -0.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 481.409s -> 481.18s (-0.05%) |
ba1d61e to
b9f0815
Compare
This comment has been minimized.
This comment has been minimized.
This file has several methods that take a `FnOnce() -> R` closure: - `DepGraph::with_ignore` - `DepGraph::with_query_deserialization` - `DepGraph::with_anon_task` - `DepGraphData::with_anon_task_inner` It also has two methods that take a faux closure via an `A` argument and a `fn(TyCtxt<'tcx>, A) -> R` argument: - DepGraph::with_task - DepGraphData::with_task The rationale is that the faux closure exercises tight control over what state they have access to. This seems silly when (a) they are passed a `TyCtxt`, and (b) when similar nearby functions take real closures. And they are more awkward to use, e.g. requiring multiple arguments to be gathered into a tuple. This commit changes the faux closures to real closures.
b9f0815 to
deb901c
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I have updated this, removing all the parts that changed existing closure type and variable names. I used |
|
Zalathar has low review availability right now, so let's switch reviewers. As per this comment:
This is now a reduced version of the original PR. |
|
@bors r+ |
|
@bors rollup |
…=petrochenkov Use closures more consistently in `dep_graph.rs`. This file has several methods that take a `FnOnce() -> R` closure: - `DepGraph::with_ignore` - `DepGraph::with_query_deserialization` - `DepGraph::with_anon_task` - `DepGraphData::with_anon_task_inner` It also has two methods that take a faux closure via an `A` argument and a `fn(TyCtxt<'tcx>, A) -> R` argument: - DepGraph::with_task - DepGraphData::with_task The rationale is that the faux closure exercises tight control over what state they have access to. This seems silly when (a) they are passed a `TyCtxt`, and (b) when similar nearby functions take real closures. And they are more awkward to use, e.g. requiring multiple arguments to be gathered into a tuple. This commit changes the faux closures to real closures. r? @Zalathar
…uwer Rollup of 10 pull requests Successful merges: - #155227 (`rust-analyzer` subtree update) - #153335 (Add #![unstable_removed(..)] attribute to track removed features) - #154932 (Handle RTN projections in assoc type restriction diagnostics) - #155096 (delegation: support proper interaction of user-specified args and impl Traits) - #155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`) - #155140 (add regression test for OpenOptionsExt downstream compat) - #155182 (Make the expansion of guard metavars begin guard non-terminals) - #155226 (delegation: revert execution of hir_crate_items before delayed lowering) - #153997 (Use closures more consistently in `dep_graph.rs`.) - #155003 (update thin-vec)
Rollup merge of #153997 - nnethercote:closure-consistency, r=petrochenkov Use closures more consistently in `dep_graph.rs`. This file has several methods that take a `FnOnce() -> R` closure: - `DepGraph::with_ignore` - `DepGraph::with_query_deserialization` - `DepGraph::with_anon_task` - `DepGraphData::with_anon_task_inner` It also has two methods that take a faux closure via an `A` argument and a `fn(TyCtxt<'tcx>, A) -> R` argument: - DepGraph::with_task - DepGraphData::with_task The rationale is that the faux closure exercises tight control over what state they have access to. This seems silly when (a) they are passed a `TyCtxt`, and (b) when similar nearby functions take real closures. And they are more awkward to use, e.g. requiring multiple arguments to be gathered into a tuple. This commit changes the faux closures to real closures. r? @Zalathar
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#155227 (`rust-analyzer` subtree update) - rust-lang/rust#153335 (Add #![unstable_removed(..)] attribute to track removed features) - rust-lang/rust#154932 (Handle RTN projections in assoc type restriction diagnostics) - rust-lang/rust#155096 (delegation: support proper interaction of user-specified args and impl Traits) - rust-lang/rust#155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`) - rust-lang/rust#155140 (add regression test for OpenOptionsExt downstream compat) - rust-lang/rust#155182 (Make the expansion of guard metavars begin guard non-terminals) - rust-lang/rust#155226 (delegation: revert execution of hir_crate_items before delayed lowering) - rust-lang/rust#153997 (Use closures more consistently in `dep_graph.rs`.) - rust-lang/rust#155003 (update thin-vec)
…uwer Rollup of 10 pull requests Successful merges: - rust-lang/rust#155227 (`rust-analyzer` subtree update) - rust-lang/rust#153335 (Add #![unstable_removed(..)] attribute to track removed features) - rust-lang/rust#154932 (Handle RTN projections in assoc type restriction diagnostics) - rust-lang/rust#155096 (delegation: support proper interaction of user-specified args and impl Traits) - rust-lang/rust#155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`) - rust-lang/rust#155140 (add regression test for OpenOptionsExt downstream compat) - rust-lang/rust#155182 (Make the expansion of guard metavars begin guard non-terminals) - rust-lang/rust#155226 (delegation: revert execution of hir_crate_items before delayed lowering) - rust-lang/rust#153997 (Use closures more consistently in `dep_graph.rs`.) - rust-lang/rust#155003 (update thin-vec)
View all comments
This file has several methods that take a
FnOnce() -> Rclosure:DepGraph::with_ignoreDepGraph::with_query_deserializationDepGraph::with_anon_taskDepGraphData::with_anon_task_innerIt also has two methods that take a faux closure via an
Aargument and afn(TyCtxt<'tcx>, A) -> Rargument:The rationale is that the faux closure exercises tight control over what state they have access to. This seems silly when (a) they are passed a
TyCtxt, and (b) when similar nearby functions take real closures. And they are more awkward to use, e.g. requiring multiple arguments to be gathered into a tuple. This commit changes the faux closures to real closures.r? @Zalathar