diff options
| author | bors <bors@rust-lang.org> | 2024-02-16 14:11:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-16 14:11:10 +0000 |
| commit | ae9d7b0c6434b27e4e2effe8f05b16d37e7ef33f (patch) | |
| tree | 13b91c58194303a12567c8c39577246f72b137ff /library/proc_macro | |
| parent | c9a7db6e20c8892f770b94dd6d5a16a03721b658 (diff) | |
| parent | da3db9a4f7e00790fa792c69004da542c87909ce (diff) | |
| download | rust-ae9d7b0c6434b27e4e2effe8f05b16d37e7ef33f.tar.gz rust-ae9d7b0c6434b27e4e2effe8f05b16d37e7ef33f.zip | |
Auto merge of #116385 - kornelski:maybe-rename, r=Amanieu
Rename MaybeUninit::write_slice A step to push #79995 forward. https://github.com/rust-lang/libs-team/issues/122 also suggested to make them inherent methods, but they can't be — they'd conflict with slice's regular methods.
Diffstat (limited to 'library/proc_macro')
| -rw-r--r-- | library/proc_macro/src/bridge/arena.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/proc_macro/src/bridge/arena.rs b/library/proc_macro/src/bridge/arena.rs index c2b046ae41e..f81f2152cd0 100644 --- a/library/proc_macro/src/bridge/arena.rs +++ b/library/proc_macro/src/bridge/arena.rs @@ -105,7 +105,7 @@ impl Arena { #[allow(clippy::mut_from_ref)] // arena allocator pub(crate) fn alloc_str<'a>(&'a self, string: &str) -> &'a mut str { let alloc = self.alloc_raw(string.len()); - let bytes = MaybeUninit::write_slice(alloc, string.as_bytes()); + let bytes = MaybeUninit::copy_from_slice(alloc, string.as_bytes()); // SAFETY: we convert from `&str` to `&[u8]`, clone it into the arena, // and immediately convert the clone back to `&str`. |
