eclipse-zenoh / zenoh

zenoh unifies data in motion, data in-use, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.
https://zenoh.io
Other
1.44k stars 151 forks source link

zenoh-codec-1.0.0-alpha.2: unsafe function not covered #1234

Closed roby2014 closed 2 months ago

roby2014 commented 3 months ago

Describe the bug

   Compiling zenoh-codec v1.0.0-alpha.2
   Compiling zenoh-config v1.0.0-alpha.2
error[E0133]: call to unsafe function `with_slot` is unsafe and requires unsafe function or block
   --> /home/roby/.cargo/registry/src/index.crates.io-6f17d22bba15001f/zenoh-codec-1.0.0-alpha.2/src/core/zint.rs:115:9
    |
115 | /         writer.with_slot(VLE_LEN_MAX, move |buffer| {
116 | |             let mut len = 0;
117 | |             while (x & !0x7f_u64) != 0 {
118 | |                 // SAFETY: buffer is guaranteed to be VLE_LEN long where VLE_LEN is
...   |
141 | |             len
142 | |         })?;
    | |__________^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior

For more information about this error, try `rustc --explain E0133`.
error: could not compile `zenoh-codec` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

To reproduce

Use the crate and try to build.

System info

roby2014 commented 3 months ago

I think this error ocurred after I also upgraded my zenoh-plugin-rest to 1.0.0-alpha.2 (?)

diogomatsubara commented 3 months ago

@roby2014 The 1.0.0-alpha.2 crate is busted. It was released by mistake and will be yanked from crates.io. This week we will release a new alpha properly. Apologies for the inconvenience

diogomatsubara commented 2 months ago

1.0.0-alpha.4 has been released correctly so you shouldn't see any errors. Let me know if it works for you @roby2014. Please re-open if you continue to see issues