You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(This has already been reported in #32836 (comment) but not as a proper issue, and I still encountered this today, so filed a separated issue here to ensure it is still visible.)
Test case:
unionU{x:u32,y:f32,}fnmain(){let u = U{x:0x3f800000};let _f = unsafe{ u.y};}
This produces an unused field warning, which is incorrect:
warning: field is never used: `x`
--> src/main.rs:2:5
|
2 | x: u32,
| ^^^^^^
|
= note: #[warn(dead_code)] on by default
The initialization of field x should also be considered a use.
Repro on playground, all of stable (1.19.0), beta (1.20.0-beta.1) and nightly (1.20.0-nightly ae98ebf 2017-07-20).
The text was updated successfully, but these errors were encountered:
(This has already been reported in #32836 (comment) but not as a proper issue, and I still encountered this today, so filed a separated issue here to ensure it is still visible.)
Test case:
This produces an unused field warning, which is incorrect:
The initialization of field
x
should also be considered a use.Repro on playground, all of stable (1.19.0), beta (1.20.0-beta.1) and nightly (1.20.0-nightly ae98ebf 2017-07-20).
The text was updated successfully, but these errors were encountered: