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

regression: attributes on expressions are experimental #103244

Closed
Mark-Simulacrum opened this issue Oct 19, 2022 · 2 comments · Fixed by #103430
Closed

regression: attributes on expressions are experimental #103244

Mark-Simulacrum opened this issue Oct 19, 2022 · 2 comments · Fixed by #103430
Assignees
Labels
E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc P-critical Critical priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Mark-Simulacrum Mark-Simulacrum added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. regression-from-stable-to-beta Performance or correctness regression from stable to beta. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc labels Oct 19, 2022
@Mark-Simulacrum Mark-Simulacrum added this to the 1.65.0 milestone Oct 19, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Oct 19, 2022
@ehuss
Copy link
Contributor

ehuss commented Oct 19, 2022

This seems to be caused by #100232 (cc @cjgillot).

Here's a little repro:

macro_rules! foo {
    () => {
        #[allow(unreachable_patterns)]
        {
            123i32
        }
    };
}

fn main() {
    let _ = foo!().abs();
}

Technically the error is correct, the attribute is being used in an expression in this example. Due to the strange rules for when attributes are allowed on expressions, I'm guessing that self was previously being rewritten to be an argument, which does allow attributes.

@cjgillot cjgillot self-assigned this Oct 19, 2022
@apiraino
Copy link
Contributor

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-critical

@rustbot rustbot added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Oct 20, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Oct 25, 2022
…enkov

Workaround unstable stmt_expr_attributes for method receiver expressions

Fixes rust-lang#103244

cc `@Mark-Simulacrum` `@ehuss`
@bors bors closed this as completed in c9a04cd Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc P-critical Critical priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants