-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delegation: support generics for delegation from free functions #125929
Conversation
HIR ty lowering was modified cc @fmease |
@rustbot author |
r? types |
532b20d
to
c6bc7ef
Compare
This comment has been minimized.
This comment has been minimized.
c6bc7ef
to
f31cdc5
Compare
@rustbot ready |
r? fmease |
f31cdc5
to
69c5534
Compare
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (1ddedba): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)Results (primary 0.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -2.2%, secondary 2.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 770.079s -> 769.935s (-0.02%) |
Delegation: querify `sig_id` getter Possible perf fix for rust-lang#125929 r? `@petrochenkov`
Delegation: second attempt to improve perf Possible perf fix for rust-lang#125929 r? `@petrochenkov`
The perf regression is addressed in #128441. |
…enkov Delegation: second attempt to improve perf Possible perf fix for rust-lang#125929 r? `@petrochenkov`
Delegation: second attempt to improve perf Possible perf fix for rust-lang/rust#125929 r? `@petrochenkov`
@rustbot label: +perf-regression-triaged |
Delegation: second attempt to improve perf Possible perf fix for rust-lang/rust#125929 r? `@petrochenkov`
…try> Delegation: support generics in associated delegation items This is a continuation of rust-lang#125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
…etrochenkov Delegation: support generics in associated delegation items This is a continuation of rust-lang#125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
…etrochenkov Delegation: support generics in associated delegation items This is a continuation of rust-lang#125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
…etrochenkov Delegation: support generics in associated delegation items This is a continuation of rust-lang#125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
…etrochenkov Delegation: support generics in associated delegation items This is a continuation of rust-lang#125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
Delegation: support generics in associated delegation items This is a continuation of rust-lang/rust#125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
Delegation: support generics in associated delegation items This is a continuation of rust-lang/rust#125929. [design](https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md) Generic parameters inheritance was implemented in all contexts. Generic arguments are not yet supported. r? `@petrochenkov`
(The PR was split from #123958, explainer - https://github.com/Bryanskiy/posts/blob/master/delegation%20in%20generic%20contexts.md)
This PR implements generics inheritance from free functions to free functions and trait methods.
free functions to free functions:
Generics, predicates and signature are simply copied. Generic arguments in paths are ignored during generics inheritance:
Due to implementation limitations callee path is lowered without modifications. Therefore, it is a compilation error at the moment.
free functions to trait methods:
The inheritance is similar to the previous case but with some corrections:
Self
parameter converted intoT: Trait
Arguments are similarly ignored.
In the future, we plan to support generic inheritance for delegating from all contexts to all contexts (from free/trait/impl to free/trait /impl). These cases were considered first as the simplest from the implementation perspective.