Open
Description
A repository that I maintain recently received a bug report about our proc macro generating a warning after they upgraded to 1.79.0
.
I haven't bisected for the exact commit that introduces the warning, but I have been able to reproduce it in 1.79.0
.
Minimal Reproduction
fn main() {}
mod private_mod {
#[repr(C)]
pub enum MyEnum {
Variant(u32)
}
#[no_mangle]
pub extern "C" fn some_function() -> MyEnum {
MyEnum::Variant(5)
}
}
Compiling playground v0.0.1 (/playground)
warning: field `0` is never read
--> src/main.rs:6:17
|
6 | Variant(u32)
| ------- ^^^
| |
| field in this variant
|
= note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
6 | Variant(())
| ~~
warning: `playground` (bin "playground") generated 1 warning
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.85s
Running `target/debug/playground`
In the playground -> https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3f5c81c0749130a6e46fbea14cbb055f
Potential Candidates
This comment links to some rustc
commits that may have introduced the issue chinedufn/swift-bridge#278 (comment)
As mentioned, I haven't taken the time to bisect since I know that it's possible that a core maintainer already has a good sense of when/how this regression could have been introduced.