Skip to content

Unable to build with --no-default-features and using bindings + serde features #207

Open
@AngheloAlf

Description

@AngheloAlf

Tested on commit 22052ea10b47258402513e44951cccde4600f4c7

There seems to be some kind of issue on the build generators if you disable std (--no-default-features) and use both bindings and serde features.
I get lots of errors like the following:

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `std`
    --> /home/angie/Documents/n64decomp/objdiff/target/debug/build/objdiff-core-de1552b3e1803e72/out/objdiff.report.serde.rs:1787:46
     |
1787 |     fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
     |                                              ^^^ use of unresolved module or unlinked crate `std`
     |
     = help: if you wanted to use a crate named `std`, use `cargo add std` to add it to your `Cargo.toml`
help: consider importing this module
    -->  objdiff-core/src/bindings/report.rs:3:1
     |
3    + use core::result;
     |
help: if you import `result`, refer to it directly
     |
1787 -     fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1787 +     fn serialize<S>(&self, serializer: S) -> result::Result<S::Ok, S::Error>
     |

Manually changing the std:: uses to core:: fix almost every error, but I couldn't find a proper fix without manual intervention.

This command reproduces the issue

$ cargo build -p objdiff-core --no-default-features -F bindings,serde

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions