expected `DynamicImage`, found `image::dynimage::DynamicImage`
adampwells opened this issue · 1 comments
adampwells commented
This has just started happening in a tokio/axum project
I updated the rust build environment to the latest, and now:
error[E0308]: mismatched types
--> /Users/awells/.cargo/registry/src/index.crates.io-6f17d22bba15001f/thumbnailer-0.5.1/src/formats/image_format.rs:24:8
|
24 | Ok(webp_image.to_image())
| -- ^^^^^^^^^^^^^^^^^^^^^ expected `DynamicImage`, found `image::dynimage::DynamicImage`
| |
| arguments to this enum variant are incorrect
|
= note: `image::dynimage::DynamicImage` and `DynamicImage` have similar names, but are actually distinct types
note: `image::dynimage::DynamicImage` is defined in crate `image`
--> /Users/awells/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.25.1/src/dynimage.rs:50:1
|
50 | pub enum DynamicImage {
| ^^^^^^^^^^^^^^^^^^^^^
note: `DynamicImage` is defined in crate `image`
--> /Users/awells/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.24.9/src/dynimage.rs:55:1
|
55 | pub enum DynamicImage {
| ^^^^^^^^^^^^^^^^^^^^^
= note: perhaps two different versions of crate `image` are being used?
help: the type constructed contains `image::dynimage::DynamicImage` due to the type of the argument passed
--> /Users/awells/.cargo/registry/src/index.crates.io-6f17d22bba15001f/thumbnailer-0.5.1/src/formats/image_format.rs:24:5
|
24 | Ok(webp_image.to_image())
| ^^^---------------------^
| |
| this argument influences the type of `Ok`
note: tuple variant defined here
--> /Users/awells/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:506:5
|
506 | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
| ^^
adampwells commented
There are two different version of image imported:
├── thumbnailer v0.5.1
│ ├── image v0.24.9
│ │ ├── bytemuck v1.15.0
│ │ ├── byteorder v1.4.3
│ │ ├── color_quant v1.1.0
│ │ ├── exr v1.72.0
│ │ │ ├── bit_field v0.10.2
│ │ │ ├── flume v0.11.0
│ │ │ │ └── spin v0.9.8 (*)
│ │ │ ├── half v2.4.0
│ │ │ │ └── cfg-if v1.0.0
│ │ │ ├── lebe v0.5.2
│ │ │ ├── miniz_oxide v0.7.1 (*)
│ │ │ ├── rayon-core v1.12.1 (*)
│ │ │ ├── smallvec v1.13.2
│ │ │ └── zune-inflate v0.2.54
│ │ │ └── simd-adler32 v0.3.7
│ │ ├── gif v0.13.1
│ │ │ ├── color_quant v1.1.0
│ │ │ └── weezl v0.1.8
│ │ ├── jpeg-decoder v0.3.1
│ │ │ └── rayon v1.10.0 (*)
│ │ ├── num-traits v0.2.18 (*)
│ │ ├── png v0.17.13
│ │ │ ├── bitflags v1.3.2
│ │ │ ├── crc32fast v1.3.2 (*)
│ │ │ ├── fdeflate v0.3.4
│ │ │ │ └── simd-adler32 v0.3.7
│ │ │ ├── flate2 v1.0.28 (*)
│ │ │ └── miniz_oxide v0.7.1 (*)
│ │ ├── qoi v0.4.1
│ │ │ └── bytemuck v1.15.0
│ │ └── tiff v0.9.1
│ │ ├── flate2 v1.0.28 (*)
│ │ ├── jpeg-decoder v0.3.1 (*)
│ │ └── weezl v0.1.8
│ ├── lazy_static v1.4.0 (*)
│ ├── mime v0.3.17
│ ├── rayon v1.10.0 (*)
│ ├── tempfile v3.5.0 (*)
│ └── webp v0.2.7
│ ├── image v0.25.1
│ │ ├── bytemuck v1.15.0
│ │ ├── byteorder v1.4.3
│ │ └── num-traits v0.2.18 (*)
│ └── libwebp-sys v0.9.5
│ [build-dependencies]
│ ├── cc v1.0.83 (*)
│ └── glob v0.3.1