Skip to content

RA doesn't seem to respect cfg on fields #4063

@Lokathor

Description

@Lokathor
pub struct ZlibByteIter<'s> {
  pub(crate) current: &'s [u8],
  pub(crate) idat_iter: IdatIter<'s>,
  #[cfg(not(feature = "png_skip_adler_checks"))]
  pub(crate) adler: u32,
}

impl<'s> ZlibByteIter<'s> {
  fn from_current_and_iter(current: &'s [u8], idat_iter: IdatIter<'s>) -> Self {
    #[cfg(not(feature = "png_skip_adler_checks"))]
    {
      Self { current, idat_iter, adler: 1 }
    }
    #[cfg(feature = "png_skip_adler_checks")]
    {
      Self { current, idat_iter }
    }
  }
}

This will report the second cfg variant as missing the adler field, which doesn't exist under that configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions