X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=library%2Fstd%2Fsrc%2Fsys_common%2Fwtf8.rs;h=6e29bc61454c85076260a5f6412702a790506f04;hb=23637e20cdf3f7b8e01b42dbaf25357e5d3c31ae;hp=0629859bd9dcc15bc232b502366bf21512500ff7;hpb=3bfde2f1f4fc9409ecb63dfe1370df66171cf861;p=rust.git diff --git a/library/std/src/sys_common/wtf8.rs b/library/std/src/sys_common/wtf8.rs index 0629859bd9d..6e29bc61454 100644 --- a/library/std/src/sys_common/wtf8.rs +++ b/library/std/src/sys_common/wtf8.rs @@ -809,7 +809,8 @@ impl<'a> Iterator for Wtf8CodePoints<'a> { #[inline] fn next(&mut self) -> Option { - next_code_point(&mut self.bytes).map(|c| CodePoint { value: c }) + // SAFETY: `self.bytes` has been created from a WTF-8 string + unsafe { next_code_point(&mut self.bytes).map(|c| CodePoint { value: c }) } } #[inline]