Skip to content

rust: Fix the serialize feature when std is disabled - #9510

Open
grandpaul wants to merge 1 commit into
google:masterfrom
grandpaul:paulliu-fix-std
Open

grandpaul wants to merge 1 commit into
google:masterfrom
grandpaul:paulliu-fix-std

Conversation

@grandpaul

Copy link
Copy Markdown

The serialize feature does not imply std, so the crate can be built with --no-default-features --features serialize, in which case lib.rs enables #![no_std]. The Serialize implementations for Array and Vector still referred to std::result::Result, so the crate failed to compile in that configuration:

error[E0433]: cannot find module or crate std in this scope
--> src/array.rs:152:46

Use core::result::Result instead. It is available in both configurations and is the same type as std::result::Result when std is enabled.

The `serialize` feature does not imply `std`, so the crate can be
built with `--no-default-features --features serialize`, in which
case lib.rs enables `#![no_std]`.  The `Serialize` implementations
for `Array` and `Vector` still referred to `std::result::Result`,
so the crate failed to compile in that configuration:

 error[E0433]: cannot find module or crate `std` in this scope
    --> src/array.rs:152:46

Use `core::result::Result` instead.  It is available in both
configurations and is the same type as `std::result::Result` when
`std` is enabled.

Signed-off-by: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant