mirror of https://github.com/rust-lang/rust.git
fix typo: intialized -> initialized
This commit is contained in:
parent
7ddad349b1
commit
7a3a668bc9
|
@ -52,7 +52,7 @@ impl<'a> ReadBuf<'a> {
|
||||||
|
|
||||||
/// Creates a new `ReadBuf` from a fully uninitialized buffer.
|
/// Creates a new `ReadBuf` from a fully uninitialized buffer.
|
||||||
///
|
///
|
||||||
/// Use `assume_init` if part of the buffer is known to be already inintialized.
|
/// Use `assume_init` if part of the buffer is known to be already initialized.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn uninit(buf: &'a mut [MaybeUninit<u8>]) -> ReadBuf<'a> {
|
pub fn uninit(buf: &'a mut [MaybeUninit<u8>]) -> ReadBuf<'a> {
|
||||||
ReadBuf { buf, filled: 0, initialized: 0 }
|
ReadBuf { buf, filled: 0, initialized: 0 }
|
||||||
|
@ -145,7 +145,7 @@ impl<'a> ReadBuf<'a> {
|
||||||
byte.write(0);
|
byte.write(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// SAFETY: we just inintialized uninit bytes, and the previous bytes were already init
|
// SAFETY: we just initialized uninit bytes, and the previous bytes were already init
|
||||||
unsafe {
|
unsafe {
|
||||||
self.assume_init(n);
|
self.assume_init(n);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#![feature(rustc_attrs)]
|
#![feature(rustc_attrs)]
|
||||||
|
|
||||||
// Test to ensure that we can handle cases where
|
// Test to ensure that we can handle cases where
|
||||||
// let statements create no bindings are intialized
|
// let statements create no bindings are initialized
|
||||||
// using a Place expression
|
// using a Place expression
|
||||||
//
|
//
|
||||||
// Note: Currently when feature `capture_disjoint_fields` is enabled
|
// Note: Currently when feature `capture_disjoint_fields` is enabled
|
||||||
|
|
Loading…
Reference in New Issue