Hi @kaizhang,
First, thanks for the nice crate! I was able to get anndata support working for our rust single-cell tool fairly easily!
I'm posting because I discovered a strange conflict when I include this crate along with flate2 (with my preferred cloudflare-zlib implementation)
I posted the issue in more detail in the flate2 repository. However, essentially, the following Cargo.toml is sufficient to trigger the problem:
[package]
name = "test_flate2"
version = "0.1.0"
edition = "2021"
[dependencies]
anndata = "0.6.1"
flate2 = { version = "1.0.35", features = ["cloudflare_zlib"] }
This results in the following compiler error:
error[E0308]: mismatched types
--> /home/rob/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flate2-1.0.35/src/ffi/c.rs:65:25
|
65 | zalloc: Some(allocator::zalloc),
| ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found `Option<extern "C" fn(..., ..., ...) -> ... {z
alloc}>`
|
= note: expected fn pointer `unsafe extern "C" fn(*mut c_void, u32, u32) -> *mut c_void`
found enum `Option<extern "C" fn(*mut c_void, u32, u32) -> *mut c_void {zalloc}>`
error[E0308]: mismatched types
--> /home/rob/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flate2-1.0.35/src/ffi/c.rs:67:24
|
67 | zfree: Some(allocator::zfree),
| ^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found `Option<extern "C" fn(..., ...) {zfree}>`
|
= note: expected fn pointer `unsafe extern "C" fn(*mut c_void, *mut c_void)`
found enum `Option<extern "C" fn(*mut c_void, *mut c_void) {zfree}>`
For more information about this error, try `rustc --explain E0308`.
error: could not compile `flate2` (lib) due to 2 previous errors
So it seems there is some conflicting / improper definition or it is somehow being included in the wrong place? Hopefully we can figure out what's triggering this so that this crate can be used successfully with flate2 with any of the zlib backends.
Hi @kaizhang,
First, thanks for the nice crate! I was able to get anndata support working for our rust single-cell tool fairly easily!
I'm posting because I discovered a strange conflict when I include this crate along with flate2 (with my preferred
cloudflare-zlibimplementation)I posted the issue in more detail in the flate2 repository. However, essentially, the following
Cargo.tomlis sufficient to trigger the problem:This results in the following compiler error:
So it seems there is some conflicting / improper definition or it is somehow being included in the wrong place? Hopefully we can figure out what's triggering this so that this crate can be used successfully with
flate2with any of the zlib backends.