Comments (12)
This one: https://doc.rust-lang.org/std/num/struct.NonZeroI16.html ?
It should be stable as of 1.34.
from abomonation.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Got it, thanks!
from abomonation.
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)
- potential issue with unsafe_abomonate! on latest version HOT 2
- `impl Abomonation for u/i128` HOT 7
- Shouldn't exhume take a NonNull<Self> rather than a &mut Self? HOT 11
- Shouldn't entomb and encode take a self rather than a &self? HOT 2
- Shouldn't decode return an &mut T rather than a &T? HOT 6
- macros 1.1 derive implementation HOT 2
- Consider taking writers by value HOT 8
- Is inline_always really needed?
- Can the pointer alignment situation be improved? HOT 7
- Is it okay to implement Abomonation for both T and &T? HOT 8
- Is it a good idea to implement Abomonation for non-abomonable PhantomData?
- Define a framing protocol HOT 2
- Should Abomonated use StableDeref?
- Should abomonation start using trybuild tests?
- A possible path forward for padding bytes HOT 13
- Paypal
- Implementations for standard library types HOT 1
- Sanitize addresses in serialized data.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abomonation.