| 1 | # Copyright 2018 The Fuchsia Authors |
| 2 | # |
| 3 | # Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0 |
| 4 | # <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT |
| 5 | # license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option. |
| 6 | # This file may not be copied, modified, or distributed except according to |
| 7 | # those terms. |
| 8 | |
| 9 | # Put both crates in a single workspace so that `trybuild` compiler errors have |
| 10 | # paths that are stable regardless of the path to the repository root. This |
| 11 | # avoids issues like: |
| 12 | # https://github.com/dtolnay/trybuild/issues/207#issuecomment-131227.594 |
| 13 | [workspace] |
| 14 | |
| 15 | [package] |
| 16 | edition = "2018" |
| 17 | name = "zerocopy" |
| 18 | version = "0.7.35" |
| 19 | authors = ["Joshua Liebow-Feeser <joshlf@google.com>" ] |
| 20 | description = "Utilities for zero-copy parsing and serialization" |
| 21 | categories = ["embedded" , "encoding" , "no-std::no-alloc" , "parsing" , "rust-patterns" ] |
| 22 | keywords = ["cast" , "convert" , "transmute" , "transmutation" , "type-punning" ] |
| 23 | license = "BSD-2-Clause OR Apache-2.0 OR MIT" |
| 24 | repository = "https://github.com/google/zerocopy" |
| 25 | rust-version = "1.60.0" |
| 26 | |
| 27 | exclude = [".*" ] |
| 28 | |
| 29 | [package.metadata.docs.rs] |
| 30 | all-features = true |
| 31 | rustdoc-args = ["--cfg" , "doc_cfg" , "--generate-link-to-definition" ] |
| 32 | |
| 33 | [package.metadata.ci] |
| 34 | # The versions of the stable and nightly compiler toolchains to use in CI. |
| 35 | pinned-stable = "1.79.0" |
| 36 | pinned-nightly = "nightly-2024-06-19" |
| 37 | |
| 38 | [package.metadata.playground] |
| 39 | features = ["__internal_use_only_features_that_work_on_stable" ] |
| 40 | |
| 41 | [features] |
| 42 | default = ["byteorder" ] |
| 43 | |
| 44 | alloc = [] |
| 45 | derive = ["zerocopy-derive" ] |
| 46 | simd = [] |
| 47 | simd-nightly = ["simd" ] |
| 48 | # This feature depends on all other features that work on the stable compiler. |
| 49 | # We make no stability guarantees about this feature; it may be modified or |
| 50 | # removed at any time. |
| 51 | __internal_use_only_features_that_work_on_stable = ["alloc" , "derive" , "simd" ] |
| 52 | |
| 53 | [dependencies] |
| 54 | zerocopy-derive = { version = "=0.7.35" , path = "zerocopy-derive" , optional = true } |
| 55 | |
| 56 | [dependencies.byteorder] |
| 57 | version = "1.3" |
| 58 | default-features = false |
| 59 | optional = true |
| 60 | |
| 61 | # The "associated proc macro pattern" ensures that the versions of zerocopy and |
| 62 | # zerocopy-derive remain equal, even if the 'derive' feature isn't used. |
| 63 | # See: https://github.com/matklad/macro-dep-test |
| 64 | [target.'cfg(any())'.dependencies] |
| 65 | zerocopy-derive = { version = "=0.7.35" , path = "zerocopy-derive" } |
| 66 | |
| 67 | [dev-dependencies] |
| 68 | assert_matches = "1.5" |
| 69 | itertools = "0.11" |
| 70 | rand = { version = "0.8.5" , features = ["small_rng" ] } |
| 71 | rustversion = "1.0" |
| 72 | static_assertions = "1.1" |
| 73 | testutil = { path = "testutil" } |
| 74 | # Pinned to a specific version so that the version used for local development |
| 75 | # and the version used in CI are guaranteed to be the same. Future versions |
| 76 | # sometimes change the output format slightly, so a version mismatch can cause |
| 77 | # CI test failures. |
| 78 | trybuild = { version = "=1.0.85" , features = ["diff" ] } |
| 79 | # In tests, unlike in production, zerocopy-derive is not optional |
| 80 | zerocopy-derive = { version = "=0.7.35" , path = "zerocopy-derive" } |
| 81 | # TODO(#381) Remove this dependency once we have our own layout gadgets. |
| 82 | elain = "0.3.0" |
| 83 | |