Delegation: support coercion for target expression#126699
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 17, 2024
Merged
Delegation: support coercion for target expression#126699bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
Author
|
@rustbot author |
29 tasks
de488f2 to
1e5a473
Compare
Contributor
Author
|
@rustbot ready |
Contributor
|
The PR needs a high level description - how exactly does it solve #118212 (comment) (in a few sentences). |
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this pull request
Jun 25, 2024
…ctoring, r=petrochenkov Delegation: ast lowering refactor refactoring changes for rust-lang#126699 r? `@petrochenkov`
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this pull request
Jun 25, 2024
…ctoring, r=petrochenkov Delegation: ast lowering refactor refactoring changes for rust-lang#126699 r? ``@petrochenkov``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jun 25, 2024
…ctoring, r=petrochenkov Delegation: ast lowering refactor refactoring changes for rust-lang#126699 r? ```@petrochenkov```
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 25, 2024
Rollup merge of rust-lang#126947 - Bryanskiy:delegation-lowering-refactoring, r=petrochenkov Delegation: ast lowering refactor refactoring changes for rust-lang#126699 r? ```@petrochenkov```
This comment was marked as resolved.
This comment was marked as resolved.
1e5a473 to
64d78b4
Compare
Contributor
Author
|
@rustbot ready |
64d78b4 to
02a1f30
Compare
9568e12 to
784f358
Compare
petrochenkov
approved these changes
Jul 16, 2024
Contributor
Contributor
Author
|
@rustbot ready |
compiler-errors
approved these changes
Jul 16, 2024
Contributor
|
r=me after the nit |
784f358 to
7ee97f9
Compare
Contributor
Author
|
@bors r=compiler-errors |
Collaborator
|
@Bryanskiy: 🔑 Insufficient privileges: Not in reviewers |
Contributor
|
@bors r=compiler-errors,petrochenkov |
Contributor
|
@bors r=compiler-errors |
Collaborator
Collaborator
Contributor
|
lol race condition |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 16, 2024
Rollup of 7 pull requests Successful merges: - rust-lang#124033 (Sync ar_archive_writer to LLVM 18.1.3) - rust-lang#126699 (Delegation: support coercion for target expression) - rust-lang#126762 (Deny keyword lifetimes pre-expansion) - rust-lang#126967 (Promote the `wasm32-wasip2` target to Tier 2) - rust-lang#127390 (Migrate `raw-dylib-inline-cross-dylib` and `raw-dylib-custom-dlltool` `run-make` tests to rmake) - rust-lang#127501 (Invert infer `error_reporting` mod struture) - rust-lang#127816 (Update method name to reflect changes to its internals) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 17, 2024
Rollup merge of rust-lang#126699 - Bryanskiy:delegation-coercion, r=compiler-errors Delegation: support coercion for target expression (solves rust-lang#118212 (comment)) The implementation consist of 2 parts. Firstly, method call is generated instead of fully qualified call in AST->HIR lowering if there were no generic arguments or `Qpath` were provided. These restrictions are imposed due to the loss of information after desugaring. For example in ```rust trait Trait { fn foo(&self) {} } reuse <u8 as Trait>::foo; ``` We would like to generate such a code: ```rust fn foo<u8: Trait>(x: &u8) { x.foo(x) } ``` however, the signature is inherited during HIR analysis where `u8` was discarded. Then, we probe the single pre-resolved method. P.S In the future, we would like to avoid restrictions on the callee path by `Self` autoref/autoderef in fully qualified calls, but at the moment it didn't work out. r? `@petrochenkov`
Member
|
Thanks for taking over this and sorry for not being able to look at this on time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(solves #118212 (comment))
The implementation consist of 2 parts. Firstly, method call is generated instead of fully qualified call in AST->HIR lowering if there were no generic arguments or
Qpathwere provided. These restrictions are imposed due to the loss of information after desugaring. For example inWe would like to generate such a code:
however, the signature is inherited during HIR analysis where
u8was discarded.Then, we probe the single pre-resolved method.
P.S In the future, we would like to avoid restrictions on the callee path by
Selfautoref/autoderef in fully qualified calls, but at the moment it didn't work out.r? @petrochenkov