Rollup merge of #49103 - glandium:uninitialized, r=cramertj
Use an uninitialized buffer in GenericRadix::fmt_int, like in Display::fmt for numeric types The code using a slice of that buffer is only ever going to use bytes that are subsequently initialized.
This commit is contained in:
commit
fc9dfda6ad
1 changed files with 1 additions and 1 deletions
|
|
@ -63,7 +63,7 @@ trait GenericRadix {
|
|||
// characters for a base 2 number.
|
||||
let zero = T::zero();
|
||||
let is_nonnegative = x >= zero;
|
||||
let mut buf = [0; 128];
|
||||
let mut buf: [u8; 128] = unsafe { mem::uninitialized() };
|
||||
let mut curr = buf.len();
|
||||
let base = T::from_u8(Self::BASE);
|
||||
if is_nonnegative {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue