pydantic / pydantic-core

Core validation logic for pydantic written in rust
MIT License
1.34k stars 207 forks source link

Lower MSRV to 1.75 #1315

Closed tiran closed 1 month ago

tiran commented 1 month ago

pydantic-core 2.18.4 sets minimum supported Rust version to 1.76 in its Cargo.toml. That is higher than actually necessary. pydantic-core compiles and tests just fine with Rust 1.75. I would like to lower MSRV to 1.75.

Motivation: The latest versions of RHEL 8 (8.10) and RHEL 9 (9.4) as well as UBI 8 and UBI 9 container images have Rust 1.75. I would like to build pydantic-core from sources without patching.

PS: Rust 1.74 and earlier versions are not supported. https://github.com/rust-lang/rust/issues/91611 feature stabilized in Rust 1.75.

      error[E0562]: `impl Trait` only allowed in function and inherent method return types, not in trait method return types
         --> src/input/input_abstract.rs:208:23
          |
      208 |     fn iter(&self) -> impl Iterator<Item = Self::Item<'_>>;
          |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
          |
          = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information