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] 16edition = "2018" 17name = "zerocopy" 18version = "0.7.34" 19authors = ["Joshua Liebow-Feeser <joshlf@google.com>"] 20description = "Utilities for zero-copy parsing and serialization" 21categories = ["embedded", "encoding", "no-std::no-alloc", "parsing", "rust-patterns"] 22keywords = ["cast", "convert", "transmute", "transmutation", "type-punning"] 23license = "BSD-2-Clause OR Apache-2.0 OR MIT" 24repository = "https://github.com/google/zerocopy" 25rust-version = "1.60.0" 26 27exclude = [".*"] 28 29[package.metadata.docs.rs] 30all-features = true 31rustdoc-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. 35pinned-stable = "1.78.0" 36pinned-nightly = "nightly-2024-05-05" 37 38[package.metadata.playground] 39features = ["__internal_use_only_features_that_work_on_stable"] 40 41[features] 42default = ["byteorder"] 43 44alloc = [] 45derive = ["zerocopy-derive"] 46simd = [] 47simd-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] 54zerocopy-derive = { version = "=0.7.34", path = "zerocopy-derive", optional = true } 55 56[dependencies.byteorder] 57version = "1.3" 58default-features = false 59optional = 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] 65zerocopy-derive = { version = "=0.7.34", path = "zerocopy-derive" } 66 67[dev-dependencies] 68assert_matches = "1.5" 69itertools = "0.11" 70rand = { version = "0.8.5", features = ["small_rng"] } 71rustversion = "1.0" 72static_assertions = "1.1" 73testutil = { 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. 78trybuild = { version = "=1.0.85", features = ["diff"] } 79# In tests, unlike in production, zerocopy-derive is not optional 80zerocopy-derive = { version = "=0.7.34", path = "zerocopy-derive" } 81# TODO(#381) Remove this dependency once we have our own layout gadgets. 82elain = "0.3.0" 83