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

Workaround unstable stmt_expr_attributes for method receiver expressions #103430

Merged
merged 1 commit into from
Oct 26, 2022

Conversation

cjgillot
Copy link
Contributor

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

r? @jackh726

(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 Oct 23, 2022
@jackh726
Copy link
Member

Going to re-roll because I'm not familiar with this code.

r? rust-lang/compiler

@cjgillot cjgillot added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Oct 24, 2022
@petrochenkov
Copy link
Contributor

This seems to be a major overkill, I think adding only fn visit_method_receiver_expr and not calling maybe_emit_expr_attr_err in it in InvocationCollector should be enough?

@petrochenkov petrochenkov added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 24, 2022
@cjgillot
Copy link
Contributor Author

This is the first thing I tried.
However, if the receiver is a macro expansion, we'll get an AstFragment::Expr, which does not know it comes from a method receiver. So it will call the regular visit_expr method, which triggers the feature gate.
The simplest solution would be to stabilize the feature, but t-lang probably won't let us backport that 😆.

@petrochenkov petrochenkov added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 25, 2022
@petrochenkov
Copy link
Contributor

Ugh and sigh.
@bors r+

@bors
Copy link
Contributor

bors commented Oct 25, 2022

📌 Commit 74d4eef has been approved by petrochenkov

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 Oct 25, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Oct 25, 2022
…enkov

Workaround unstable stmt_expr_attributes for method receiver expressions

Fixes rust-lang#103244

cc `@Mark-Simulacrum` `@ehuss`
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 26, 2022
Rollup of 10 pull requests

Successful merges:

 - rust-lang#102951 (suggest type annotation for local statement initialed by ref expression)
 - rust-lang#103209 (Diagnostic derives: allow specifying multiple alternative suggestions)
 - rust-lang#103287 (Use a faster allocation size check in slice::from_raw_parts)
 - rust-lang#103416 (Name the `impl Trait` in region bound suggestions)
 - rust-lang#103430 (Workaround unstable stmt_expr_attributes for method receiver expressions)
 - rust-lang#103444 (Remove extra type error after missing semicolon error)
 - rust-lang#103520 (rustc_middle: Rearrange resolver outputs structures slightly)
 - rust-lang#103533 (Use &self instead of &mut self for cast methods)
 - rust-lang#103536 (Remove `rustc_driver::set_sigpipe_handler()`)
 - rust-lang#103542 (Pinning tests for some `macro_rules!` errors discussed in the lang meeting)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c9a04cd into rust-lang:master Oct 26, 2022
@rustbot rustbot added this to the 1.66.0 milestone Oct 26, 2022
@cjgillot cjgillot deleted the receiver-attrs branch October 26, 2022 11:45
@pnkfelix
Copy link
Member

pnkfelix commented Oct 27, 2022

Discussed in today's T-compiler triage meeting

We decided to first look into reverting PR #100232 (see in PR #103633) before falling back on risking a beta backport of this PR #103430.

(Thus, I'm not removing the nomination label until #103633 lands, but I'm not adding a beta-accepted label either.)

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.
@Mark-Simulacrum
Copy link
Member

Dropping beta-nominated; we've reverted the problematic PR.

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.

regression: attributes on expressions are experimental
8 participants