rust-lang / rust · Issue No. 163160
This is the tracking issue for the unstable_imports future-compatibility warning and other related errors. The goal of this page is to describe why this change was made and how you can fix code that is affected by it. It also provides a place to ask questions or register a complaint if you feel the change should not be made. For more information on the policy around future-compatibility warnings, see our breaking change policy guidelines.
Several import paths through the intrinsics module were accidentally allowed. They are stably available through other modules; these import paths should be used instead.
Supporting this behavior (through the rustc_allowed_through_unstable_modules attribute) significantly complicates stability checking in the compiler, we would like to be able to get rid of the hacks required for it.
use {std/core}::intrinsics::{transmute/copy/copy_nonoverlapping/write_bytes};
Import these items through the {core/std}::mem module (for transmute) and {std/core}::ptr module (for the other items) instead. rustfix can apply these fixes automatically.
The fallout, at this time, would be significant, see https://github.com/rust-lang/rust/pull/157082#issuecomment-4744383141. Especially older rand-core versions are heavily affected, but note that since that crater run new minor versions of the affected rand-core crate have been released (much thanks to @dhardy).
Relay reads this issue against the repository's contribution signals: the files it is likely to touch, how the maintainers triage work this size, and what the first contribution would exercise.
The full analysis for this issue is still being assembled. Until then, the description above and the thread on GitHub are the most reliable context.