diff options
| author | bors <bors@rust-lang.org> | 2025-08-27 06:15:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-08-27 06:15:42 +0000 |
| commit | 4f808ba6bf9f1c8dde30d009e73386d984491587 (patch) | |
| tree | 8f378b61026d3d288f48ff896e702c646232ed4c /library/std/src/sys | |
| parent | 269d5b56bcfdf2be82213e72ef9a2e4c592a8c6b (diff) | |
| parent | 5fdc8406ee01199573959ea29bc182ca78555416 (diff) | |
| download | rust-4f808ba6bf9f1c8dde30d009e73386d984491587.tar.gz rust-4f808ba6bf9f1c8dde30d009e73386d984491587.zip | |
Auto merge of #145916 - matthiaskrgr:rollup-cnvhq2z, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang/rust#142215 (Use -Zmir-opt-level=0 in tests for MIR building) - rust-lang/rust#143341 (Mention that casting to *const () is a way to roundtrip with from_raw_parts) - rust-lang/rust#145078 (Fix wrong cache line size of riscv64) - rust-lang/rust#145290 (Improve std::fs::read_dir docs) - rust-lang/rust#145335 (Move WTF-8 code from std into core and alloc) - rust-lang/rust#145904 (Move `riscv64-gc-unknown-linux-musl` from Tier 2 with Host tools to Tier 2) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/os_str/wtf8.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/library/std/src/sys/os_str/wtf8.rs b/library/std/src/sys/os_str/wtf8.rs index bbc704ebf86..96da891874e 100644 --- a/library/std/src/sys/os_str/wtf8.rs +++ b/library/std/src/sys/os_str/wtf8.rs @@ -1,12 +1,12 @@ //! The underlying OsString/OsStr implementation on Windows is a //! wrapper around the "WTF-8" encoding; see the `wtf8` module for more. +use alloc::wtf8::{Wtf8, Wtf8Buf}; use core::clone::CloneToUninit; use crate::borrow::Cow; use crate::collections::TryReserveError; use crate::rc::Rc; use crate::sync::Arc; -use crate::sys_common::wtf8::{Wtf8, Wtf8Buf, check_utf8_boundary}; use crate::sys_common::{AsInner, FromInner, IntoInner}; use crate::{fmt, mem}; @@ -220,7 +220,9 @@ impl Buf { /// trailing surrogate half. #[inline] pub unsafe fn extend_from_slice_unchecked(&mut self, other: &[u8]) { - self.inner.extend_from_slice(other); + unsafe { + self.inner.extend_from_slice_unchecked(other); + } } } @@ -238,7 +240,7 @@ impl Slice { #[track_caller] #[inline] pub fn check_public_boundary(&self, index: usize) { - check_utf8_boundary(&self.inner, index); + self.inner.check_utf8_boundary(index); } #[inline] |
