Skip to content

Conversation

@ileixe
Copy link

@ileixe ileixe commented Sep 10, 2024

Build was failed in current main

owned-buf$ cargo check
    Checking owned-buf v0.2.0 (/home/ys/Source/Projects/rust/owned-buf)
error[E0599]: no function or associated item named `write_slice` found for union `MaybeUninit` in the current scope
   --> src/lib.rs:535:26
    |
535 |             MaybeUninit::write_slice(&mut self.as_mut()[..data.len()], data);
    |                          ^^^^^^^^^^^ function or associated item not found in `MaybeUninit<_>`
    |
note: if you're trying to build a new `MaybeUninit<_>` consider using one of the following associated functions:
      MaybeUninit::<T>::new
      MaybeUninit::<T>::uninit
      MaybeUninit::<T>::zeroed
   --> /home/ys/Source/.asdf/installs/rust/nightly/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/maybe_uninit.rs:290:5
    |
290 |     pub const fn new(val: T) -> MaybeUninit<T> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
313 |     pub const fn uninit() -> MaybeUninit<T> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
402 |     pub const fn zeroed() -> MaybeUninit<T> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0599`.
error: could not compile `owned-buf` (lib) due to 1 previous error

To follow API update1, change MaybeUninit::write_slice() to copy_from_slice().

To follow API update[1], change MaybeUninit::write_slice() to
copy_from_slice().

[1]: rust-lang/rust#116385
@ileixe
Copy link
Author

ileixe commented Sep 10, 2024

@nrc Hi, I'm trying to explore your trait work: https://github.com/nrc/portable-interoperable/blob/master/io-traits/README.md and found this issue. Can you take a look?

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.

1 participant