We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 432972c commit 02a1ab8Copy full SHA for 02a1ab8
library/core/src/fmt/num.rs
@@ -88,7 +88,9 @@ unsafe trait GenericRadix: Sized {
88
};
89
}
90
91
- let buf = &buf[curr..];
+ // SAFETY: `curr` is initialized to `buf.len()` and is only decremented,
92
+ // so it is always in bounds.
93
+ let buf = unsafe { buf.get_unchecked(curr..) };
94
// SAFETY: The only chars in `buf` are created by `Self::digit` which are assumed to be
95
// valid UTF-8
96
let buf = unsafe {
0 commit comments