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.32"
19authors = ["Joshua Liebow-Feeser <joshlf@google.com>"]
20description = "Utilities for zero-copy parsing and serialization"
21license = "BSD-2-Clause OR Apache-2.0 OR MIT"
22repository = "https://github.com/google/zerocopy"
23rust-version = "1.60.0"
24
25exclude = [".*"]
26
27[package.metadata.docs.rs]
28all-features = true
29rustdoc-args = ["--cfg", "doc_cfg", "--generate-link-to-definition"]
30
31[package.metadata.ci]
32# The versions of the stable and nightly compiler toolchains to use in CI.
33pinned-stable = "1.74.0"
34pinned-nightly = "nightly-2023-12-05"
35
36[package.metadata.playground]
37features = ["__internal_use_only_features_that_work_on_stable"]
38
39[features]
40default = ["byteorder"]
41
42alloc = []
43derive = ["zerocopy-derive"]
44simd = []
45simd-nightly = ["simd"]
46# This feature depends on all other features that work on the stable compiler.
47# We make no stability guarantees about this feature; it may be modified or
48# removed at any time.
49__internal_use_only_features_that_work_on_stable = ["alloc", "derive", "simd"]
50
51[dependencies]
52zerocopy-derive = { version = "=0.7.32", path = "zerocopy-derive", optional = true }
53
54[dependencies.byteorder]
55version = "1.3"
56default-features = false
57optional = true
58
59# The "associated proc macro pattern" ensures that the versions of zerocopy and
60# zerocopy-derive remain equal, even if the 'derive' feature isn't used.
61# See: https://github.com/matklad/macro-dep-test
62[target.'cfg(any())'.dependencies]
63zerocopy-derive = { version = "=0.7.32", path = "zerocopy-derive" }
64
65[dev-dependencies]
66assert_matches = "1.5"
67itertools = "0.11"
68rand = { version = "0.8.5", features = ["small_rng"] }
69rustversion = "1.0"
70static_assertions = "1.1"
71testutil = { path = "testutil" }
72# Pinned to a specific version so that the version used for local development
73# and the version used in CI are guaranteed to be the same. Future versions
74# sometimes change the output format slightly, so a version mismatch can cause
75# CI test failures.
76trybuild = { version = "=1.0.85", features = ["diff"] }
77# In tests, unlike in production, zerocopy-derive is not optional
78zerocopy-derive = { version = "=0.7.32", path = "zerocopy-derive" }
79# TODO(#381) Remove this dependency once we have our own layout gadgets.
80elain = "0.3.0"
81