Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make prost a
no_std
compatible library, and prost-build able to gen…
…erate `no_std` code The alternative is to get collections types from `core` and `alloc`. In the `no_std` mode in `prost_build`, we force it to always use BTreeMap since HashMap was not stabilized in `alloc::collections` library. The functionality is identical and the only incompatibilities in the interface are that we cannot use `std::error::Error` or `std::io::Error` in `no_std` mode because these types have not been moved to `alloc` and there is no alternative.
- Loading branch information
Showing
9 changed files
with
122 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[package] | ||
name = "tests-alloc" | ||
version = "0.0.0" | ||
authors = ["Dan Burkert <dan@danburkert.com>"] | ||
publish = false | ||
edition = "2018" | ||
|
||
build = "../tests/src/build.rs" | ||
|
||
[lib] | ||
doctest = false | ||
path = "../tests/src/lib.rs" | ||
|
||
[features] | ||
default = ["nostd-collections"] | ||
nostd-collections = [] | ||
|
||
[dependencies] | ||
bytes = "0.4.7" | ||
cfg-if = "0.1" | ||
prost = { path = ".." } | ||
prost-types = { path = "../prost-types" } | ||
protobuf = { path = "../protobuf" } | ||
|
||
[dev-dependencies] | ||
diff = "0.1" | ||
prost-build = { path = "../prost-build" } | ||
tempfile = "3" | ||
|
||
[build-dependencies] | ||
cfg-if = "0.1" | ||
env_logger = { version = "0.6", default-features = false } | ||
prost-build = { path = "../prost-build" } | ||
protobuf = { path = "../protobuf" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters