inflation / jpegxl-rs

GNU General Public License v3.0
62 stars 12 forks source link

error[E0658]: use of unstable library feature 'ptr_from_ref' #60

Closed y-guyon closed 4 months ago

y-guyon commented 4 months ago

To reproduce:

cargo new jpegxl-rs-test
cd jpegxl-rs-test
cargo add jpegxl-rs -F vendored
cargo build

I get (cargo 1.72.0):

Compiling jpegxl-rs v0.10.3+libjxl-0.10.2 error[E0658]: use of unstable library feature 'ptr_from_ref' --> /home/yguyon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/jpegxl-rs-0.10.3+libjxl-0.10.2/src/memory.rs:42:21

42 |             opaque: std::ptr::from_ref::<Self>(self).cast_mut().cast(),
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^

= note: see issue #106116 https://github.com/rust-lang/rust/issues/106116 for more information

Is this expected?

y-guyon commented 4 months ago

https://doc.rust-lang.org/std/ptr/fn.from_ref.html indicates "Stable since Rust version 1.76.0, const since 1.76.0". So I guess I cannot use jpegxl-rs with my version of cargo.

inflation commented 4 months ago

Current MSRV is set to 1.74 after someone else pointed this out.

y-guyon commented 4 months ago

Indeed: https://github.com/inflation/jpegxl-rs/issues/59

I wonder if there is some setting that could warn users that their Rust version is below [workspace.package]'s rust-version.

inflation commented 4 months ago

Indeed: #59

I wonder if there is some setting that could warn users that their Rust version is below [workspace.package]'s rust-version.

Cargo is working on this