Skip to content
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

Fix the definition of sigevent #2813

Closed
wants to merge 6 commits into from
Closed

Commits on Dec 20, 2023

  1. Fix the definition of sigevent

    It was originally defined back before rust could represent C unions.  So
    instead of defining the union field correctly, it simply defined that
    union's most useful field.  Define it correctly now.
    
    Include a backwards-compatibility mechanism: Rename sigevent's old
    definition and hide it.  Implement Deref and DerefMut from sigevent to
    the old definition, so consumers will still be able to use the old field
    name.
    asomers committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    3c21a9f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c77fdd6 View commit details
    Browse the repository at this point in the history
  3. Prevent safe construction of struct sigevent

    sigevent's Debug, PartialEq, and Hash trait impls might read union
    fields that could be potentially uninitialized by a standard
    initializer.  Those trait impls shouldn't be present (see
    rust-lang#2816), but can't easily be
    removed.  Until they get removed, the constructor must be `unsafe` to
    force the user to zero all fields.
    
    The same issue applies to the Deref<Target=sigevent_0_2_126> trait impl,
    which exists only for backwards compatibility.
    asomers committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    84057ce View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7064630 View commit details
    Browse the repository at this point in the history
  5. Disable the 1-s!-macro-per-file style rule

    Rust 1.14.0 and earlier don't correctly expand #[cfg()] attributes
    within the macro, sometimes necessitating multiple s! macros per file.
    asomers committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    c72e45f View commit details
    Browse the repository at this point in the history
  6. style

    asomers committed Dec 20, 2023
    Configuration menu
    Copy the full SHA
    62d6477 View commit details
    Browse the repository at this point in the history