Giter VIP home page Giter VIP logo

Comments (12)

frankmcsherry avatar frankmcsherry commented on August 23, 2024

This one: https://doc.rust-lang.org/std/num/struct.NonZeroI16.html ?

It should be stable as of 1.34.

from abomonation.

ryzhyk avatar ryzhyk commented on August 23, 2024

Oh, I see. I think this is still a problem, though, as I would prefer not to depend on the latest compiler. E.g., folks running the build farm here insist on using Rust from the Linux distro, which is apparently 1.28 on rhel.

from abomonation.

frankmcsherry avatar frankmcsherry commented on August 23, 2024

Ok. There is a bit of a conflict in that other people would like to be using NonZeroI* types. :D

Are you able to patch in version 0.7.0 for abomonation by using:

https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#overriding-dependencies

from abomonation.

ryzhyk avatar ryzhyk commented on August 23, 2024

I tried

[patch.crates-io]
abomonation = "0.7.0"

but

error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`

Caused by:
  patch for `abomonation` in `https://github.com/rust-lang/crates.io-index` points to the same source, but patches must point to different sources

from abomonation.

ryzhyk avatar ryzhyk commented on August 23, 2024

Isn't there a way to put these behind a feature gate, so that people with recent compilers can enjoy the functionality without breaking stuff for less up-to-date environments?

from abomonation.

frankmcsherry avatar frankmcsherry commented on August 23, 2024

I've just pushed a 0.7.2 that has them behind the #[cfg(feature = "nonzero")] Rust feature flag (thanks @benesch!). But, I think you'll need to get the version up at some point. I can't build timely or differential with 1.28.0 (via rustup) due to edition issues. The tests for abomonation fail because Ipv6Addr::LOCALHOST only got added in 1.30, etc.

If only there were a company that could virtualize environments to allow you to use more recent version... ;)

from abomonation.

frankmcsherry avatar frankmcsherry commented on August 23, 2024

Oops. We'll have to return to this. That feature flag apparently sucks. Or at least, it is not actually visible (this effectively turns off support for NonZeroI*).

from abomonation.

frankmcsherry avatar frankmcsherry commented on August 23, 2024

One thing you can try, though, is to pin Cargo.lock to a specific abomonation version. As long as you don't update it, you should sit at 0.7.0. It's not great, but .. none of this is. :)

from abomonation.

ryzhyk avatar ryzhyk commented on August 23, 2024

Sorry, I'm confused. 0.7.2 seems to work. Are you saying that it is going to break again soon or will @benesch's PR solve the issue when merged?

Thanks,
Leonid

from abomonation.

benesch avatar benesch commented on August 23, 2024

Assuming I did things right, the next version will restore support for abomonating NonZeroI* types in Rust >= 1.34 without breaking compilation for Rust < 1.34. 0.7.2 solved your compilation issue at the expense of breaking abomonation of NonZeroI* for everyone, whoops!

from abomonation.

ryzhyk avatar ryzhyk commented on August 23, 2024

Got it, thanks!

from abomonation.

frankmcsherry avatar frankmcsherry commented on August 23, 2024

The reached conclusion here (with @ryzhyk's blessing) is to move forward and not sweat the recentness of nonzero signed integers. Feel free to reopen if that seems in error.

from abomonation.

Related Issues (19)

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.