Use LocalDefId for more tcx method calls#154371
Use LocalDefId for more tcx method calls#154371rust-bors[bot] merged 4 commits intorust-lang:mainfrom
Conversation
|
@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 LocalDefId for more tcx method calls
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (3c6dc09): comparison URL. Overall result: no relevant changes - 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 countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -2.3%, secondary 2.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 4.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 482.838s -> 489.051s (1.29%) |
|
As the benchmark shows, in general, duplicating methods into |
| /// For example, a closure has its own `LocalDefId`, but it is type-checked | ||
| /// with the containing item. Therefore, when we fetch the `typeck` of the closure, | ||
| /// for example, we really wind up fetching the `typeck` of the enclosing fn item. | ||
| pub fn typeck_root_def_id_local(self, def_id: LocalDefId) -> LocalDefId { |
There was a problem hiding this comment.
The body can be changed to typeck_root_def_id(def_id.to_def_id()).expect_local().
(Because the copy-pasted version doesn't show perf benefits while being more complex.)
|
Most of the changes are worth keeping, actually. |
|
Reminder, once the PR becomes ready for a review, use |
ec7d272 to
62ec331
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. |
|
@rustbot ready |
|
r=me after addressing #154371 (comment). |
|
Okay, #154371 (comment) is not too important. |
Rollup of 10 pull requests Successful merges: - #154070 (Unstable book options parser) - #154371 (Use LocalDefId for more tcx method calls) - #154405 (Improve doc comment unicode guidance) - #154431 (Avoid ICE in explicit reference cast suggestion for unrelated leaf pr…) - #153528 (Fix LegacyKeyValueFormat report from docker build: mips) - #154246 (Add test for issue #101532: dead code warnings in const _) - #154421 (Rustdoc rejects html emits with json output) - #154428 (bootstrap: `-Zjson-target-spec` for synthetic targets) - #154437 (bootstrap.example.toml: Hint how to allow `build.warnings`) - #154454 (fix: [rustfmt] prevent panic when rewritng associated item delegations) Failed merges: - #154450 (Use the normal arg-parsing machinery for `-Zassert-incr-state`)
Rollup of 10 pull requests Successful merges: - #154070 (Unstable book options parser) - #154371 (Use LocalDefId for more tcx method calls) - #154405 (Improve doc comment unicode guidance) - #154431 (Avoid ICE in explicit reference cast suggestion for unrelated leaf pr…) - #153528 (Fix LegacyKeyValueFormat report from docker build: mips) - #154246 (Add test for issue #101532: dead code warnings in const _) - #154421 (Rustdoc rejects html emits with json output) - #154428 (bootstrap: `-Zjson-target-spec` for synthetic targets) - #154437 (bootstrap.example.toml: Hint how to allow `build.warnings`) - #154454 (fix: [rustfmt] prevent panic when rewritng associated item delegations) Failed merges: - #154450 (Use the normal arg-parsing machinery for `-Zassert-incr-state`)
Rollup merge of #154371 - zetanumbers:typeck_root_def_id_local, r=petrochenkov Use LocalDefId for more tcx method calls r? @petrochenkov Might bring perf improvements
View all comments
r? @petrochenkov
Might bring perf improvements