gccrs
gccrs copied to clipboard
`#[derive()]` without traits should be ignored, not give an error, even followed by invalid item
code:
//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
#[derive()]
pub fn check_ge(a: i32, b: i32) -> bool
{
a >= b
}
On top of #https://github.com/Rust-GCC/gccrs/pull/4211 :
a.rs:1:3: error: derive may only be applied to structs, enums and unions
1 | #[derive()]
| ^~~~~~
Analyzing compilation unit
Time variable wall GGC
TOTAL : 0.00 136k
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --enable-checking=release to disable checks.
Expected:
warning: unused attribute
--> a.rs:1:1
|
1 | #[derive()]
| ^^^^^^^^^^^
|
= note: `#[warn(unused_attributes)]` on by default
warning: 1 warning emitted
I think it is normal you got an error, as you try to derive a function, which is not a struct/enum or union.
Edit: It is not as it should be ignored, as it is in master
I think we can close this one now