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.32" |
19 | authors = ["Joshua Liebow-Feeser <joshlf@google.com>" ] |
20 | description = "Utilities for zero-copy parsing and serialization" |
21 | license = "BSD-2-Clause OR Apache-2.0 OR MIT" |
22 | repository = "https://github.com/google/zerocopy" |
23 | rust-version = "1.60.0" |
24 | |
25 | exclude = [".*" ] |
26 | |
27 | [package.metadata.docs.rs] |
28 | all-features = true |
29 | rustdoc-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. |
33 | pinned-stable = "1.74.0" |
34 | pinned-nightly = "nightly-2023-12-05" |
35 | |
36 | [package.metadata.playground] |
37 | features = ["__internal_use_only_features_that_work_on_stable" ] |
38 | |
39 | [features] |
40 | default = ["byteorder" ] |
41 | |
42 | alloc = [] |
43 | derive = ["zerocopy-derive" ] |
44 | simd = [] |
45 | simd-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] |
52 | zerocopy-derive = { version = "=0.7.32" , path = "zerocopy-derive" , optional = true } |
53 | |
54 | [dependencies.byteorder] |
55 | version = "1.3" |
56 | default-features = false |
57 | optional = 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] |
63 | zerocopy-derive = { version = "=0.7.32" , path = "zerocopy-derive" } |
64 | |
65 | [dev-dependencies] |
66 | assert_matches = "1.5" |
67 | itertools = "0.11" |
68 | rand = { version = "0.8.5" , features = ["small_rng" ] } |
69 | rustversion = "1.0" |
70 | static_assertions = "1.1" |
71 | testutil = { 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. |
76 | trybuild = { version = "=1.0.85" , features = ["diff" ] } |
77 | # In tests, unlike in production, zerocopy-derive is not optional |
78 | zerocopy-derive = { version = "=0.7.32" , path = "zerocopy-derive" } |
79 | # TODO(#381) Remove this dependency once we have our own layout gadgets. |
80 | elain = "0.3.0" |
81 | |