-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 in 1.26 with misplaced attributes #49934
Comments
This also happens with misplaced attributes on functions:
|
cc @alexcrichton @dtolnay -- proc-macro related changes presumably |
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! |
My guess is that this isn't related to procedural macros but rather #49291, cc @tejom and @petrochenkov |
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? |
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. |
Did a bisect run, and #49124 is the source of the ICE. cc @petrochenkov @abonander |
I saw this issue earlier and meant to comment that I was pretty sure it was my PR, so I could have saved you a bisect. However, I haven't been able to build Rust for at least a week so I'd be mostly relying on Travis to test any fixes. |
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. |
triage: P-high Has a pending fix. |
This fixes the regression in rust-lang#49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly. closes rust-lang#49934
Warn on pointless #[derive] in more places This fixes the regression in #49934 and ensures that unused `#[derive]` invocations on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. There is a separate warning hardcoded for `#[derive]` on macro invocations since linting (even the early-lint pass) occurs after expansion. This also adds regression tests for some nodes that were already warning properly. closes #49934
This fixes the regression in rust-lang#49934 and ensures that unused `#[derive]`s on statements, expressions and generic type parameters survive to trip the `unused_attributes` lint. For `#[derive]` on macro invocations it has a hardcoded warning since linting occurs after expansion. This also adds regression testing for some nodes that were already warning properly. closes rust-lang#49934
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.
The text was updated successfully, but these errors were encountered: