delegation: support Self mapping adjustments for non-first arguments#158945
Conversation
|
Maybe need to run perf, as non-delegation code was modified. |
Self mapping for non-receiver arguments
88b00af to
78083a0
Compare
Self mapping for non-receiver argumentsSelf mapping adjustments for non-receiver arguments
All the extra logic that I see happens only for delegation (i.e. after |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…rguments, r=<try> delegation: support `Self` mapping adjustments for non-receiver arguments
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (f318c88): comparison URL. Overall result: ❌ regressions - please read:Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. Next, please: If you can, justify the regressions found in this try perf run in writing along with @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 (primary 2.7%, secondary 5.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.3%, secondary -0.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.147s -> 488.401s (-0.15%) |
|
The perf changes are acceptable, if we couldn't add a single |
|
@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.
…rguments, r=<try> delegation: support `Self` mapping adjustments for non-receiver arguments
Self mapping adjustments for non-receiver argumentsSelf mapping adjustments for non-first arguments
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (2d30a6e): comparison URL. Overall result: no relevant changes - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)Results (secondary 3.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -6.8%, secondary -2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 490.017s -> 490.247s (0.05%) |
This comment has been minimized.
This comment has been minimized.
* delegation: support `Self` mapping for non-receiver arguments * Review: do not allocate `FxIndexSet` on arena, remove unnecessary derives * Review: remove ast:: prefix * Review: `r#override` -> `self_ty_override` * Review: rename `receiver` to `first_arg` * Perf fix attempt
|
🔨 6 commits were squashed into aa2eb97. |
b5c4436 to
aa2eb97
Compare
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
…rguments, r=petrochenkov delegation: support `Self` mapping adjustments for non-first arguments This PR implements initial version of Self mapping adjustments of all arguments that are needed to be mapped. The method probing routine is reused in order to find adjustments for each mapped argument, then they are processed in the same way the receiver is processed in delegation. The current solution is a bit hacky, explained in the comment: ```rust /// Hack for applying method probing routine for arbitrary types /// in order to get adjustments as if they were at receiver position. /// Used only for delegation's `Self` arguments mapping. /// FIXME(fn_delegation): now this hack is used, however in perfect world /// we would like to separate adjustments finding logic from probe context, /// if we do so we will be able to find wanted adjustments given only two /// types without reusing the whole method probing routine ``` The next part of Self mapping is to support heuristics to map complex return types: `Self` -> `Box<Arc<Self>>`. Part of #118212. r? @petrochenkov
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for f82aa26 failed: CI. Failed job:
|
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 3b58636 (parent) -> acf6a00 (this PR) Test differencesShow 49 test diffs49 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard acf6a00aff5d8aa8892aadff0b48364b50f97cf4 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (acf6a00): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis perf run didn't have relevant results for this metric. Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 490.631s -> 489.809s (-0.17%) |
View all comments
This PR implements initial version of Self mapping adjustments of all arguments that are needed to be mapped. The method probing routine is reused in order to find adjustments for each mapped argument, then they are processed in the same way the receiver is processed in delegation. The current solution is a bit hacky, explained in the comment:
The next part of Self mapping is to support heuristics to map complex return types:
Self->Box<Arc<Self>>.Part of #118212.
r? @petrochenkov