Skip to content
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

Do not consider method call receiver as an argument in AST. #100232

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Aug 7, 2022

Fixes #73663

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 7, 2022
@rustbot
Copy link
Collaborator

rustbot commented Aug 7, 2022

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rust-highfive
Copy link
Collaborator

r? @nagisa

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 7, 2022
@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot force-pushed the no-desugar-methodcall branch from 795e4a7 to 6525bd8 Compare August 7, 2022 14:41
@rustbot
Copy link
Collaborator

rustbot commented Aug 7, 2022

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@cjgillot cjgillot force-pushed the no-desugar-methodcall branch from 6525bd8 to b68402a Compare August 7, 2022 15:13
@rust-log-analyzer

This comment has been minimized.

let hir_seg = self.arena.alloc(self.lower_path_segment(
e.span,
seg,
ParamMode::Optional,
ParenthesizedGenericArgs::Err,
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
));
let args = self.lower_exprs(args);
let args = self.arena.alloc_from_iter(
[&*receiver].into_iter().chain(args.iter()).map(|x| self.lower_expr_mut(x)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given how much better the AST is from having the receiver be separate, it makes me wonder if HIR would benefit just as much…

Copy link
Member

@nagisa nagisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me. r=me once this passes CI.

@cjgillot cjgillot force-pushed the no-desugar-methodcall branch from 2402ca1 to 934d69a Compare August 9, 2022 18:09
@rust-log-analyzer

This comment has been minimized.

@cjgillot cjgillot force-pushed the no-desugar-methodcall branch from 934d69a to 69205db Compare August 10, 2022 16:35
@cjgillot
Copy link
Contributor Author

@bors r=nagisa

@bors
Copy link
Contributor

bors commented Aug 10, 2022

📌 Commit 69205db has been approved by nagisa

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 10, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 11, 2022
Rollup of 11 pull requests

Successful merges:

 - rust-lang#92744 (Check if enum from foreign crate has any non exhaustive variants when attempting a cast)
 - rust-lang#99110 (Determine match_has_guard from candidates instead of looking up thir table again)
 - rust-lang#100184 (Stabilize ptr_const_cast)
 - rust-lang#100192 ( Remove duplicated temporaries creating during box derefs elaboration)
 - rust-lang#100232 (Do not consider method call receiver as an argument in AST.)
 - rust-lang#100287 (linux: Use `pthread_setname_np` instead of `prctl`)
 - rust-lang#100351 (Use `&mut Diagnostic` instead of `&mut DiagnosticBuilder` unless needed)
 - rust-lang#100370 (Remove more Clean trait implementations)
 - rust-lang#100391 (Improve size assertions)
 - rust-lang#100398 (Improve `-Zhir-stats`)
 - rust-lang#100403 (Improve error messages when running rustdoc GUI tests)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1c43cab into rust-lang:master Aug 11, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 11, 2022
@cjgillot cjgillot deleted the no-desugar-methodcall branch August 11, 2022 20:50
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 5, 2022
…ents-in-hir, r=cjgillot

Separate the receiver from arguments in HIR

Related to rust-lang#100232

cc `@cjgillot`
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 9, 2022
…ents-in-hir, r=cjgillot

Separate the receiver from arguments in HIR

Related to rust-lang#100232

cc `@cjgillot`
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 28, 2022
…s-split, r=pnkfelix

Revert "Do not consider method call receiver as an argument in AST."

Reverts rust-lang#100232, including a few places where there were merge conflicts after this landed.

r? `@pnkfelix`
cc `@cjgillot`

cc rust-lang#103430 the nightly workaround for this issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: #cfg usage in a macro call
7 participants