Skip to content

Commit 820540a

Browse files
authored
Rollup merge of #129804 - ranger-ross:fixed-documentation-typos, r=Noratrieb
Fixed some typos in the standard library documentation/comments I spent some time to fix a few typos in `library/std` and `library/core`
2 parents 8c28989 + cbf92fc commit 820540a

File tree

12 files changed

+15
-15
lines changed

12 files changed

+15
-15
lines changed

library/alloc/src/collections/btree/map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3302,7 +3302,7 @@ impl<'a, K: Ord, V, A: Allocator + Clone> CursorMutKey<'a, K, V, A> {
33023302
Some(kv)
33033303
}
33043304

3305-
/// Removes the precending element from the `BTreeMap`.
3305+
/// Removes the preceding element from the `BTreeMap`.
33063306
///
33073307
/// The element that was removed is returned. The cursor position is
33083308
/// unchanged (after the removed element).
@@ -3408,7 +3408,7 @@ impl<'a, K: Ord, V, A: Allocator + Clone> CursorMut<'a, K, V, A> {
34083408
self.inner.remove_next()
34093409
}
34103410

3411-
/// Removes the precending element from the `BTreeMap`.
3411+
/// Removes the preceding element from the `BTreeMap`.
34123412
///
34133413
/// The element that was removed is returned. The cursor position is
34143414
/// unchanged (after the removed element).

library/alloc/src/collections/btree/set.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2298,7 +2298,7 @@ impl<'a, T: Ord, A: Allocator + Clone> CursorMut<'a, T, A> {
22982298
self.inner.remove_next().map(|(k, _)| k)
22992299
}
23002300

2301-
/// Removes the precending element from the `BTreeSet`.
2301+
/// Removes the preceding element from the `BTreeSet`.
23022302
///
23032303
/// The element that was removed is returned. The cursor position is
23042304
/// unchanged (after the removed element).
@@ -2384,7 +2384,7 @@ impl<'a, T: Ord, A: Allocator + Clone> CursorMutKey<'a, T, A> {
23842384
self.inner.remove_next().map(|(k, _)| k)
23852385
}
23862386

2387-
/// Removes the precending element from the `BTreeSet`.
2387+
/// Removes the preceding element from the `BTreeSet`.
23882388
///
23892389
/// The element that was removed is returned. The cursor position is
23902390
/// unchanged (after the removed element).

library/core/src/array/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub use iter::IntoIter;
3737
///
3838
/// # Example
3939
///
40-
/// Creating muliple copies of a `String`:
40+
/// Creating multiple copies of a `String`:
4141
/// ```rust
4242
/// #![feature(array_repeat)]
4343
///

library/core/src/future/async_drop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ async unsafe fn surface_drop_in_place<T: Drop + ?Sized>(ptr: *mut T) {
157157
unsafe { crate::ops::fallback_surface_drop(&mut *ptr) }
158158
}
159159

160-
/// Wraps a future to continue outputing `Poll::Ready(())` once after
160+
/// Wraps a future to continue outputting `Poll::Ready(())` once after
161161
/// wrapped future completes by returning `Poll::Ready(())` on poll. This
162162
/// is useful for constructing async destructors to guarantee this
163163
/// "fuse" property
@@ -223,7 +223,7 @@ where
223223
/// # Safety
224224
///
225225
/// Same as `async_drop_in_place` except is lazy to avoid creating
226-
/// multiple mutable refernces.
226+
/// multiple mutable references.
227227
#[lang = "async_drop_defer"]
228228
async unsafe fn defer<T: ?Sized>(to_drop: *mut T) {
229229
// SAFETY: same safety requirements as `async_drop_in_place`

library/core/src/intrinsics/mir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ define!(
310310
);
311311
define!(
312312
"mir_unwind_cleanup",
313-
/// An unwind action that continues execution in a given basic blok.
313+
/// An unwind action that continues execution in a given basic block.
314314
fn UnwindCleanup(goto: BasicBlock) -> UnwindActionArg
315315
);
316316

library/core/src/macros/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ pub(crate) mod builtin {
10721072
/// If the environment variable is not defined, then a compilation error
10731073
/// will be emitted. To not emit a compile error, use the [`option_env!`]
10741074
/// macro instead. A compilation error will also be emitted if the
1075-
/// environment variable is not a vaild Unicode string.
1075+
/// environment variable is not a valid Unicode string.
10761076
///
10771077
/// # Examples
10781078
///

library/std/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn main() {
142142

143143
// Configure platforms that have reliable basics but may have unreliable math.
144144

145-
// LLVM is currenlty adding missing routines, <https://github.com/llvm/llvm-project/issues/93566>
145+
// LLVM is currently adding missing routines, <https://github.com/llvm/llvm-project/issues/93566>
146146
let has_reliable_f16_math = has_reliable_f16
147147
&& match (target_arch.as_str(), target_os.as_str()) {
148148
// FIXME: Disabled on Miri as the intrinsics are not implemented yet.

library/std/src/io/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ fn read_buf_full_read() {
738738
#[test]
739739
// Miri does not support signalling OOM
740740
#[cfg_attr(miri, ignore)]
741-
// 64-bit only to be sure the allocator will fail fast on an impossible to satsify size
741+
// 64-bit only to be sure the allocator will fail fast on an impossible to satisfy size
742742
#[cfg(target_pointer_width = "64")]
743743
fn try_oom_error() {
744744
let mut v = Vec::<u8>::new();

library/std/src/rt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ fn lang_start_internal(
146146
rtabort!("drop of the panic payload panicked");
147147
});
148148
panic::catch_unwind(cleanup).map_err(rt_abort)?;
149-
// Guard against multple threads calling `libc::exit` concurrently.
149+
// Guard against multiple threads calling `libc::exit` concurrently.
150150
// See the documentation for `unique_thread_exit` for more information.
151151
panic::catch_unwind(|| crate::sys::exit_guard::unique_thread_exit()).map_err(rt_abort)?;
152152
ret_code

library/std/src/sync/mpmc/list.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ impl<T> Channel<T> {
551551

552552
let mut head = self.head.index.load(Ordering::Acquire);
553553
// The channel may be uninitialized, so we have to swap to avoid overwriting any sender's attempts
554-
// to initalize the first block before noticing that the receivers disconnected. Late allocations
554+
// to initialize the first block before noticing that the receivers disconnected. Late allocations
555555
// will be deallocated by the sender in Drop.
556556
let mut block = self.head.block.swap(ptr::null_mut(), Ordering::AcqRel);
557557

library/std/src/sys/pal/uefi/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ mod uefi_command_internal {
470470
let st_size = unsafe { (*self.st.as_ptr()).hdr.header_size as usize };
471471
let mut crc32: u32 = 0;
472472

473-
// Set crc to 0 before calcuation
473+
// Set crc to 0 before calculation
474474
unsafe {
475475
(*self.st.as_mut_ptr()).hdr.crc32 = 0;
476476
}

library/std/src/sys/pal/unix/net.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ impl Socket {
215215
_ => {
216216
if cfg!(target_os = "vxworks") {
217217
// VxWorks poll does not return POLLHUP or POLLERR in revents. Check if the
218-
// connnection actually succeeded and return ok only when the socket is
218+
// connection actually succeeded and return ok only when the socket is
219219
// ready and no errors were found.
220220
if let Some(e) = self.take_error()? {
221221
return Err(e);

0 commit comments

Comments
 (0)