GithubHelp home page GithubHelp logo

Comments (7)

bluss avatar bluss commented on September 26, 2024

Thanks. What's your opinion on the feature detect approach to no-std that indexmap uses?

from indexmap.

CryZe avatar CryZe commented on September 26, 2024

I think that's mostly fine. Although I'm not sure how you could pass that on to serde.

from indexmap.

jplatte avatar jplatte commented on September 26, 2024

I think in general this is not possible given cargos rudimentary implementation of crate features. Even if there was a std feature, it would not be possible to enable serde/std only if this crates std and serde features are enabled. Doing std = ["serde/std"] under [features] would "activate" the serde dependency when the std feature is enabled, even without the serde-1 feature being enabled. Unfortunately I can't find a bug report about this in cargo's issues.

I'm also pretty sure that interacting with dependency resolution from within a build script is not possible (and doesn't seem very viable to me in general).

from indexmap.

CryZe avatar CryZe commented on September 26, 2024

Doing std = ["serde/std"] under [features] would "activate" the serde dependency when the std feature is enabled, even without the serde-1 feature being enabled.

Don't tell me this is real????? I haven't fully tested the no_std support for my crate yet (or rather how std behaves then), but that would be horrible.

from indexmap.

cuviper avatar cuviper commented on September 26, 2024

I believe the main cargo bug on mixed features is rust-lang/cargo#2589.

The detected std ability actually sidesteps this problem since cargo is not involved, which is interesting, but serde would need to do this too.

from indexmap.

jplatte avatar jplatte commented on September 26, 2024

Don't tell me this is real?????

Found it afterall: rust-lang/cargo#3494

@cuviper You are right, that would be an interesting workaround. I'm sure there are some pitfalls though...

from indexmap.

bluss avatar bluss commented on September 26, 2024

I think we can solve this with a new feature like serde-no-std, subset of current serde feature

from indexmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.