w3f / schnorrkel

Schnorr VRFs and signatures on the Ristretto group
BSD 3-Clause "New" or "Revised" License
306 stars 92 forks source link

v0.11 doesn't compile in no-std mode #92

Closed tomaka closed 10 months ago

tomaka commented 10 months ago

Depending on schnorrkel like this:

schnorrkel = { version = "0.11.1", default-features = false, features = ["alloc"] }

Leads a compilation error:

error[E0433]: failed to resolve: use of undeclared crate or module `std`
   --> /home/tomaka/.cargo/registry/src/index.crates.io-6f17d22bba15001f/schnorrkel-0.11.1/src/batch.rs:393:31
    |
393 |     let tmp: &'heap mut [T] = std::mem::take(&mut *heap);
    |                               ^^^ use of undeclared crate or module `std`

This didn't happen in v0.10

While this specific error is very easy to fix, I would suggest adding some CI tests to make sure that things actually compile. That's why CI exists after all.

koute commented 10 months ago

Done: https://github.com/w3f/schnorrkel/pull/93

burdges commented 10 months ago

I've no idea what triggered this in https://github.com/w3f/schnorrkel/commit/9ff4845c287f30763a6f78382f058ac6824947cb or elsewhere, so maybe something external triggered the alloc feature, but that's fine. Anyways published, thanks. :)