Skip to content

Regression in 1.26 with misplaced attributes #49934

Description

@emilyalbini

All the regressed crates have a misplaced #[derive] in the codebase (such as a #[derive(Debug)] above a variable declaration). In Rust 1.25 the compiler accepts the code, but in Rust 1.26 it throws an error and then crashes.

Even if we keep the error (which could be turned into a warn-by-default lint) the ICE should be fixed.

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Apr 13, 2018
  2. added this to the 1.26 milestone on Apr 13, 2018
  3. emilyalbini commented on Apr 13, 2018

    @emilyalbini
    MemberAuthor

    This also happens with misplaced attributes on functions:

  4. changed the title [-]Regression in 1.26 with misplaced derives[/-] [+]Regression in 1.26 with misplaced attributes[/+] on Apr 13, 2018
  5. Mark-Simulacrum commented on Apr 13, 2018

    @Mark-Simulacrum
    Member

    cc @alexcrichton @dtolnay -- proc-macro related changes presumably

  6. mgattozzi commented on Apr 13, 2018

    @mgattozzi
    Contributor

    I have a feeling I know where it's broken in one of my macros for chiisai based off the build log. I slapped an #[inline(always)] above a closure that gets passed to it in that macro. I'll need to confirm though. It's a non proc_macro just the regular macro_rules!

  7. alexcrichton commented on Apr 16, 2018

    @alexcrichton
    Member

    My guess is that this isn't related to procedural macros but rather #49291, cc @tejom and @petrochenkov

  8. tejom commented on Apr 16, 2018

    @tejom
    Contributor

    The change that effected inline and closures was brought up in issue #49632

    I don't mind making a change to make the original pull request a warning if that is preferred?

  9. tejom commented on Apr 16, 2018

    @tejom
    Contributor

    The ice with the derive check doesn't seem to be caused by #49291

    fn main() {
            #[derive(Debug)]
            let _a = 5;
    
            #[repr(always)]
            let _x = 12;
    }

    This compiles with stable.
    That pull request I made was in nightly on 2018-04-01, and that only has an error for the incorrect repr above _x
    With nightly from 2018-04-10 The compiler crashed after showing an error about the incorrect derive.

  10. emilyalbini commented on Apr 17, 2018

    @emilyalbini
    MemberAuthor

    Did a bisect run, and #49124 is the source of the ICE. cc @petrochenkov @abonander

  11. 1 remaining item

  12. abonander commented on Apr 18, 2018

    @abonander
    Contributor

    Ironically I'm able to work on beta and not nightly.

    However, compile-fail seems to eat the ICE because while I can reproduce it on master, I have to manually call the built rustc to get it because the compile-fail suite passes because it still produces the expected error.

  13. nikomatsakis commented on Apr 26, 2018

    @nikomatsakis
    Contributor

    triage: P-high

    Has a pending fix.

  14. added a commit that references this issue on Apr 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions