]> git.hungrycats.org Git - linux/commit
rust: zerocopy-derive: import crate
authorMiguel Ojeda <ojeda@kernel.org>
Mon, 8 Jun 2026 14:14:32 +0000 (16:14 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Tue, 9 Jun 2026 02:13:22 +0000 (04:13 +0200)
commitb437b3832874d4df88195d31b9052417674ffaed
treea096091414be5f91fd3c8d822c506e90fd84071d
parent567621523ab7a2bc4a923757cba30bde8900447a
rust: zerocopy-derive: import crate

This is a subset of the Rust `zerocopy-derive` crate, version v0.8.50
(released 2026-05-31), licensed under "BSD-2-Clause OR Apache-2.0 OR
MIT", from:

    https://github.com/google/zerocopy/tree/v0.8.50/zerocopy-derive/src

The files are copied as-is, with no modifications whatsoever (not even
adding the SPDX identifiers).

For copyright details, please see:

    https://github.com/google/zerocopy/blob/v0.8.50/README.md?plain=1
    https://github.com/google/zerocopy/blob/v0.8.50/LICENSE-BSD
    https://github.com/google/zerocopy/blob/v0.8.50/LICENSE-APACHE
    https://github.com/google/zerocopy/blob/v0.8.50/LICENSE-MIT

The next two patches modify these files as needed for use within the
kernel. This patch split allows reviewers to double-check the import
and to clearly see the differences introduced.

The following script may be used to verify the contents:

    for path in $(cd rust/zerocopy-derive/ && find . -type f); do
        curl --silent --show-error --location \
            https://github.com/google/zerocopy/raw/v0.8.50/zerocopy-derive/src/$path \
            | diff --unified rust/zerocopy-derive/$path - && echo $path: OK
    done

Cc: Joshua Liebow-Feeser <joshlf@google.com>
Cc: Jack Wrenn <jswrenn@google.com>
Link: https://patch.msgid.link/20260608141439.182634-14-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
rust/zerocopy-derive/derive/from_bytes.rs [new file with mode: 0644]
rust/zerocopy-derive/derive/into_bytes.rs [new file with mode: 0644]
rust/zerocopy-derive/derive/known_layout.rs [new file with mode: 0644]
rust/zerocopy-derive/derive/mod.rs [new file with mode: 0644]
rust/zerocopy-derive/derive/try_from_bytes.rs [new file with mode: 0644]
rust/zerocopy-derive/derive/unaligned.rs [new file with mode: 0644]
rust/zerocopy-derive/lib.rs [new file with mode: 0644]
rust/zerocopy-derive/repr.rs [new file with mode: 0644]
rust/zerocopy-derive/util.rs [new file with mode: 0644]