serde-rs / serde

Serialization framework for Rust
https://serde.rs/
Apache License 2.0
9.06k stars 767 forks source link

Compile error use of unstable feature on `nightly-2023-08-25` #2734

Closed CosmicHorrorDev closed 5 months ago

CosmicHorrorDev commented 5 months ago

serde's current master (cc865ac5236c094275b10bff4fa41e561b3e359f) fails to compile on nightly-2023-08-25 with a bunch of errors related to unstable saturating features not being enabled

$ cargo +nightly-2023-08-25 check
    Checking serde v1.0.200 (/home/wintermute/Programming/Repos/serde/serde)
error[E0658]: use of unstable library feature 'saturating_int_impl'
   --> serde/src/lib.rs:280:13
    |
280 |     pub use self::core::num::Saturating;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #87920 <https://github.com/rust-lang/rust/issues/87920> for more information
    = help: add `#![feature(saturating_int_impl)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'saturating_int_impl'
   --> serde/src/de/impls.rs:109:40
    |
109 |           impl<'de> Deserialize<'de> for Saturating<$primitive> {
    |                                          ^^^^^^^^^^^^^^^^^^^^^^
...
383 | / impl_deserialize_num! {
384 | |     i8, NonZeroI8 cfg(not(no_num_nonzero_signed)), deserialize_i8
385 | |     num_self!(i8:visit_i8);
386 | |     int_to_int!(i16:visit_i16 i32:visit_i32 i64:visit_i64);
387 | |     uint_to_self!(u8:visit_u8 u16:visit_u16 u32:visit_u32 u64:visit_u64);
388 | | }
    | |_- in this macro invocation
    |
    = note: see issue #87920 <https://github.com/rust-lang/rust/issues/87920> for more information
    = help: add `#![feature(saturating_int_impl)]` to the crate attributes to enable
    = note: this error originates in the macro `impl_deserialize_num` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0658]: use of unstable library feature 'saturating_int_impl'
   --> serde/src/de/impls.rs:109:40
    |
109 |           impl<'de> Deserialize<'de> for Saturating<$primitive> {

...

Notably this is the minimum rust version supported by the public_api crate which is causing syntect's CI to fail from a test that makes use of it

oli-obk commented 5 months ago

Oh fun. That nightly is before stabilization, but already version 1.74

I guess we need to always check for one version after the version that stabilized a feature.

Since stable users can already rely on 1.74 supporting saturating in serde, we can't take this back. Sorry about the breakage, but please just bump your nightly by a few versions to get across the stabilization threshold

CosmicHorrorDev commented 5 months ago

Makes total sense. Thanks!

CosmicHorrorDev commented 5 months ago

For reference it looks like things start compiling on/after nightly-2023-09-18