RazrFalcon / tiny-skia

A tiny Skia subset ported to Rust
BSD 3-Clause "New" or "Revised" License
1.12k stars 69 forks source link

minimal-versions: arrayref dependency version is too low #48

Closed Drakulix closed 2 years ago

Drakulix commented 2 years ago

Compiling tiny-skia with -Z minimal-versions fails with:

    Checking tiny-skia v0.6.4
error[E0502]: cannot borrow `*self` as immutable because it is also borrowed as mutable
Error:    --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-skia-0.6.4/src/pipeline/mod.rs:171:53
    |
167 |         &mut self,
    |         - let's call the lifetime of this reference `'1`
...
171 |         arrayref::array_mut_ref!(self.pixels_mut(), self.offset(dx, dy), highp::STAGE_WIDTH)
    |         --------------------------------------------^^^^^^^^^^^^^^^^^^^---------------------
    |         |                        |                  |
    |         |                        |                  immutable borrow occurs here
    |         |                        mutable borrow occurs here
    |         returning this value requires that `*self` is borrowed for `'1`
error[E0502]: cannot borrow `*self` as immutable because it is also borrowed as mutable
Error:    --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/tiny-skia-0.6.4/src/pipeline/mod.rs:180:53
    |
176 |         &mut self,
    |         - let's call the lifetime of this reference `'1`
...
180 |         arrayref::array_mut_ref!(self.pixels_mut(), self.offset(dx, dy), lowp::STAGE_WIDTH)
    |         --------------------------------------------^^^^^^^^^^^^^^^^^^^--------------------
    |         |                        |                  |
    |         |                        |                  immutable borrow occurs here
    |         |                        mutable borrow occurs here
    |         returning this value requires that `*self` is borrowed for `'1`
For more information about this error, try `rustc --explain E0502`.
error: could not compile `tiny-skia` due to 2 previous errors
Error: warning: build failed, waiting for other jobs to finish...
Error: The process '/home/runner/.cargo/bin/cargo' failed with exit code 101

Upgrading arrayref using cargo update -p arrayref fixes the issue. The "0.3" version specified in tiny-skia's Cargo.toml is too low and does not correspond to the minimal supported version.

RazrFalcon commented 2 years ago

Like this?

Drakulix commented 2 years ago

Thanks for taking care of this so quickly! Could you publish a new patch version on crates.io, if you have the time? Or is a new release on the horizon anyway?

RazrFalcon commented 2 years ago

Done.