Skip to content

Commit 7d82eb9

Browse files
committed
Fix failures on nightly
1 parent 79dccad commit 7d82eb9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/proto/h1/role.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ impl Http1Transaction for Server {
8080
// but we *never* read any of it until after httparse has assigned
8181
// values into it. By not zeroing out the stack memory, this saves
8282
// a good ~5% on pipeline benchmarks.
83-
let mut headers_indices: [HeaderIndices; MAX_HEADERS] = unsafe { mem::uninitialized() };
83+
let mut headers_indices: [HeaderIndices; MAX_HEADERS] = unsafe { mem::MaybeUninit };
8484
{
85-
let mut headers: [httparse::Header; MAX_HEADERS] = unsafe { mem::uninitialized() };
85+
let mut headers: [httparse::Header; MAX_HEADERS] = unsafe { mem::MaybeUninit };
8686
trace!("Request.parse([Header; {}], [u8; {}])", headers.len(), buf.len());
8787
let mut req = httparse::Request::new(&mut headers);
8888
let bytes = buf.as_ref();
@@ -592,9 +592,9 @@ impl Http1Transaction for Client {
592592
return Ok(None);
593593
}
594594
// Unsafe: see comment in Server Http1Transaction, above.
595-
let mut headers_indices: [HeaderIndices; MAX_HEADERS] = unsafe { mem::uninitialized() };
595+
let mut headers_indices: [HeaderIndices; MAX_HEADERS] = unsafe { mem::MaybeUninit };
596596
let (len, status, version, headers_len) = {
597-
let mut headers: [httparse::Header; MAX_HEADERS] = unsafe { mem::uninitialized() };
597+
let mut headers: [httparse::Header; MAX_HEADERS] = unsafe { mem::MaybeUninit };
598598
trace!("Response.parse([Header; {}], [u8; {}])", headers.len(), buf.len());
599599
let mut res = httparse::Response::new(&mut headers);
600600
let bytes = buf.as_ref();

0 commit comments

Comments
 (0)