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

embassy-usb: fix core::intrinsics deprecate warning in nightly. #3841

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

vDorst
Copy link
Contributor

@vDorst vDorst commented Feb 3, 2025

It seems changed in Rust rust-lang/rust#135003.
The compiler suggest to use core::mem::copy_nonoverlapping.
But that seems not exists so I used core::ptr::copy_nonoverlapping which is used in other parts in Embassy.

Replaced core::intrinsics::copy_nonoverlapping with the core::ptr::copy_nonoverlapping.

This fixed this warning.

   Compiling embassy-usb v0.4.0 (embassy/embassy-usb)
warning: use of deprecated module `core::intrinsics`: import this function via `std::mem` instead
  --> embassy/embassy-usb/src/class/cdc_ncm/mod.rs:17:23
   |
17 | use core::intrinsics::copy_nonoverlapping;
   |                       ^^^^^^^^^^^^^^^^^^^

Replaced `core::intrinsics::copy_nonoverlapping` with the
`core::ptr::copy_nonoverlapping`.

   Compiling embassy-usb v0.4.0 (embassy/embassy-usb)
warning: use of deprecated module `core::intrinsics`: import this function via `std::mem` instead
  --> embassy/embassy-usb/src/class/cdc_ncm/mod.rs:17:23
   |
17 | use core::intrinsics::copy_nonoverlapping;
   |                       ^^^^^^^^^^^^^^^^^^^
Copy link
Member

@Dirbaio Dirbaio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, we've been a victim of rust-analyzer autocomplete here, I think :)
thanks!

@Dirbaio Dirbaio enabled auto-merge February 3, 2025 21:23
@Dirbaio Dirbaio added this pull request to the merge queue Feb 3, 2025
Merged via the queue into embassy-rs:main with commit f03dca3 Feb 3, 2025
10 checks passed
@vDorst vDorst deleted the fix-core-intrinsics-deprecated branch February 3, 2025 21:36
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