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

Change write_slice() to copy_from_slice() #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

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