Use closures more consistently in dep_graph.rs.#153997
Use closures more consistently in dep_graph.rs.#153997nnethercote wants to merge 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 |
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