Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: google/zerocopy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.8.23
Choose a base ref
...
head repository: google/zerocopy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.8.24
Choose a head ref
  • 20 commits
  • 51 files changed
  • 4 contributors

Commits on Mar 6, 2025

  1. [pointer] Document validity safety invariant (#2403)

    Document the semantics of `Ptr` validity invariants on the `Validity`
    trait.
    
    Makes progress on #2226, #1866
    
    gherrit-pr-id: Ie66db9044be1dc310a6b7280a73652a357878376
    joshlf authored Mar 6, 2025
    Configuration menu
    Copy the full SHA
    52f65db View commit details
    Browse the repository at this point in the history
  2. [pointer] Support generic TransmuteFrom framework (#2408)

    This commit removes the `TransparentWrapper` trait and the
    `Ptr::transparent_wrapper_into_inner` method. It replaces them with a
    new family of transmutation traits which encode more generic
    transmutation (from any `T` to any `U`) and a set of `Ptr` methods which
    use those traits to bound transmutation operations.
    
    In particular:
    - `Dst: TransmuteFrom<Src>` denotes that a by-value transmutation is
      sound
    - `Dst: TryTransmuteFromPtr<Src>` denotes that a transmutation is sound
      so long as it can be guaranteed that the source is bit-valid for the
      destination; this is used by e.g. `Ptr::try_into_valid`, which
      performs runtime validation of bit validity
    - `Dst: TransmuteFromPtr<Src>` is equivalent to `TransmuteFrom<Src> +
      TryTransmuteFromPtr<Src>`
    
    Some type arguments are omitted in this summary. In particular, all
    three traits also take validity invariant parameters for both the source
    and destination types. Also, the `[Try]TransmuteFromPtr` traits take an
    aliasing parameter.
    
    In order to support these traits, we introduce a generalization of
    `Read` known as `MutationCompatible`. `T: MutationCompatible<U, A>`
    denotes that *either* `T: Read<A>` and `U: Read<A>` *or* `T` and `U`
    have the same interior mutation semantics (formally, it is sound for
    `&T` and `&U` to reference the same referent - safe code operating on
    these references cannot cause undefined behavior). This is a refinement
    of the "`UnsafeCell` agreement" concept that we have used before, but it
    supports types which store but don't actually use `UnsafeCell`s. For
    example, given a hypothetical `ReadOnly<T>`, the following bound holds:
    
      usize: MutationCompatible<ReadOnly<AtomicUsize>, Exclusive>
    
    This commit also takes a different approach from the one originally
    envisioned in #1945. In particular, it turns out that we don't need a
    full type-level mapping concept. Instead, we need a *predicate* over
    transitions to determine which ones are valid (e.g., it is valid to go
    from a `Valid` `MaybeUninit<T>` to an `Uninit` `MaybeUninit<T>`). By
    contrast, the invariant mapping concept suggests that each source
    validity has *exactly one* destination validity.
    
    This commit makes progress on #1940 by supporting unsized
    transmutations, but we don't yet support size shrinking or expanding
    transmutations.
    
    This commit obsoletes #1359, as that issue was predicated upon the
    existence of `TransparentWrapper`, which this commit removes.
    
    This commit closes #1226, which suggests supporting `UnsafeCell`
    agreement.
    
    Closes #1945
    Closes #1359
    Closes #2226
    Closes #1226
    Closes #1866
    Makes progress on #1359
    
    
    gherrit-pr-id: Iad14813bc6d933312bc8d7a1ddcf1aafc7126938
    
    Co-authored-by: Jack Wrenn <jswrenn@amazon.com>
    joshlf and jswrenn authored Mar 6, 2025
    Configuration menu
    Copy the full SHA
    ee12c01 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2025

  1. Implement FromZeros for AtomicPtr (#2426)

    Makes progress on #1009
    
    gherrit-pr-id: I3d825b6c6b99277c96d9fd6a6761bdfad2000473
    joshlf authored Mar 7, 2025
    Configuration menu
    Copy the full SHA
    5ad3b3f View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2025

  1. [pointer] SizeEq supports raw pointer transmutes (#2427)

    This permits us to remove the `KnownLayout` bounds from
    `Ptr::transmute`, and thus to remove `Ptr::transmute_sized` entirely.
    This also allows us to remove the hand-rolled impl of `TryFromBytes` for
    `ManuallyDrop<T>`, replacing it with an invocation of
    `impl_for_transmute_from!`.
    
    gherrit-pr-id: I090715fd9ed6f100fd35513b05054015621ecb9c
    joshlf authored Mar 8, 2025
    Configuration menu
    Copy the full SHA
    d735ecf View commit details
    Browse the repository at this point in the history
  2. Implement traits for Cell (#2421)

    Closes #1253
    
    gherrit-pr-id: I569b74086a5f98cda71b4a4131f9ce4f89dcc623
    joshlf authored Mar 8, 2025
    Configuration menu
    Copy the full SHA
    c2dd89e View commit details
    Browse the repository at this point in the history
  3. Remove obsolete safety proofs (#2423)

    * Implement traits for Cell
    
    Closes #1253
    
    gherrit-pr-id: I569b74086a5f98cda71b4a4131f9ce4f89dcc623
    
    * Remove obsolete safety proofs
    
    In #2408, we simplified the safety precondition of `unsafe_impl!`, but
    did not remove safety proofs at call sites made redundant by that
    simplification. This commit removes those now-obsolete proofs.
    
    gherrit-pr-id: I70d5aa5ace6bd2e39e679eac7f00a66d4b843d57
    joshlf authored Mar 8, 2025
    Configuration menu
    Copy the full SHA
    04cafb2 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2025

  1. [layout] Move Kani proofs from crate root (#2430)

    All moved proofs test code from the `layout` module, and so belong there
    rather than in the crate root.
    
    gherrit-pr-id: I691b42ce8c0c3c6e5990e7684fc66f8f5dd73d85
    joshlf authored Mar 11, 2025
    Configuration menu
    Copy the full SHA
    2bfd906 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2025

  1. [git] Ignore VSCode workspace files (#2443)

    gherrit-pr-id: I90b578eda7942bd1cf206c08801f5855a0ef30a0
    joshlf authored Mar 18, 2025
    Configuration menu
    Copy the full SHA
    17e39b2 View commit details
    Browse the repository at this point in the history
  2. [ci] Include doctests in coverage (#2446)

    gherrit-pr-id: I046abe912435c8944ace21c207334b002efa9ea7
    joshlf authored Mar 18, 2025
    Configuration menu
    Copy the full SHA
    8e2fe2c View commit details
    Browse the repository at this point in the history
  3. [ci] Roll pinned nightly toolchain (#2442)

    We remove `simd-nightly` impls for the `arm` target `[u]int8x4_t` types,
    which are now just type aliases for `u32` and `i32`.
    
    We also switch from using `wasm32-wasi` to `wasm32-unknown-unknown` in
    CI, as the former is less supported (and not available via `rustup` on
    this particular nightly).
    
    gherrit-pr-id: I0a19a7789334f41ffedc55b871df9736d4b51484
    google-pr-creation-bot authored Mar 18, 2025
    Configuration menu
    Copy the full SHA
    d769fb9 View commit details
    Browse the repository at this point in the history
  4. [ci] Check (but don't test) avr-none target (#2448)

    Closes #2400
    
    gherrit-pr-id: I69f30d9256afe91a6cf7619bec2b37b57ce98880
    joshlf authored Mar 18, 2025
    Configuration menu
    Copy the full SHA
    ff4a607 View commit details
    Browse the repository at this point in the history
  5. [kani] Use function contracts instead of proofs (#2449)

    gherrit-pr-id: I681bacc2fbc00531c8493490b9f982fa4aea307a
    joshlf authored Mar 18, 2025
    Configuration menu
    Copy the full SHA
    855c237 View commit details
    Browse the repository at this point in the history
  6. [byte_slice] Add Kani proofs (#2451)

    gherrit-pr-id: Ide939969b8d0c3bc117aa9f1dba06e6d570f262f
    joshlf authored Mar 18, 2025
    Configuration menu
    Copy the full SHA
    8aa96d3 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2025

  1. Configuration menu
    Copy the full SHA
    7abd7be View commit details
    Browse the repository at this point in the history
  2. [ptr] Simplify PtrInner's invariants (#2450)

    gherrit-pr-id: I855bc98cf1674d02e3750e2fc55810be79795796
    joshlf authored Mar 19, 2025
    Configuration menu
    Copy the full SHA
    31cfbd7 View commit details
    Browse the repository at this point in the history
  3. [transmute] Update TryTransmuteFromPtr proof (#2455)

    This language was made stale by the recent change to `PtrInner`'s
    invariants.
    
    gherrit-pr-id: I9e6ee4b276bf7a6ccec7b8cfbb44afd61dd36dfa
    joshlf authored Mar 19, 2025
    Configuration menu
    Copy the full SHA
    09cda40 View commit details
    Browse the repository at this point in the history
  4. [derive] Replace impl_block with builder pattern (#2456)

    This allows us to simplify a number of call sites which don't make use
    of every parameter that `impl_block` previously accepted.
    
    gherrit-pr-id: If2c6733f78dbc90d34812985a8c39ebaddb211fe
    joshlf authored Mar 19, 2025
    Configuration menu
    Copy the full SHA
    ed32df4 View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2025

  1. Configuration menu
    Copy the full SHA
    1a82be7 View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2025

  1. [derive] Support #[zerocopy(crate = "...")] attribute (#2452)

    Read the `#[zerocopy(crate = "...")]` attribute (if present), and use
    the provided path in the derive output when referencing items exported
    from zerocopy. If the attribute isn't present, then `::zerocopy` will be
    used.
    andogq authored Mar 21, 2025
    Configuration menu
    Copy the full SHA
    5056899 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    99329a9 View commit details
    Browse the repository at this point in the history
Loading