Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cargo problem illustration #9

Merged
merged 2 commits into from
Mar 29, 2024
Merged

Conversation

yellowhatter
Copy link

With this dep configuration:
{zenoh crates} -> (optional dep for "shared-memory") zenoh-shm -> zenoh-buffers ("shared-memory")

cargo build --features "shared-memory" - OK

cargo build - FAIL:

error[E0053]: method `as_mut_slice` has an incompatible type for trait
   --> commons/zenoh-sync/src/object_pool.rs:155:35
    |
155 |     fn as_mut_slice(&mut self) -> &mut [u8] {
    |                                   ^^^^^^^^^
    |                                   |
    |                                   expected `Option<&mut [u8]>`, found `&mut [u8]`
    |                                   help: change the output type to match the trait: `Option<&mut [u8]>`
    |
    = note: expected signature `fn(&mut RecyclingObject<Box<[u8]>>) -> Option<&mut [u8]>`
               found signature `fn(&mut RecyclingObject<Box<[u8]>>) -> &mut [u8]`

error[E0046]: not all trait items implemented, missing: `as_mut_slice_unchecked`
   --> commons/zenoh-sync/src/object_pool.rs:140:1
    |
140 | impl ZSliceBuffer for RecyclingObject<Box<[u8]>> {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `as_mut_slice_unchecked` in implementation
    |
    = help: implement the missing item: `unsafe fn as_mut_slice_unchecked(&mut self) -> &mut [u8] { todo!() }`

@yellowhatter
Copy link
Author

@Mallets this is a problem we discussed

@yellowhatter yellowhatter merged commit 89ea297 into shm_watchdog_poc Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants