Skip to content

Commit dbfe12d

Browse files
authored
Rollup merge of rust-lang#63189 - waywardmonkeys:doc-improvements, r=Centril
Doc improvements Miscellaneous documentation fixes.
2 parents 5155c7e + 325c6a5 commit dbfe12d

File tree

8 files changed

+16
-11
lines changed

8 files changed

+16
-11
lines changed

src/libcore/array.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,12 @@ use crate::slice::{Iter, IterMut};
2424
/// layout in memory of a fixed size array (for example, for unsafe
2525
/// initialization).
2626
///
27-
/// Note that the traits AsRef and AsMut provide similar methods for types that
27+
/// Note that the traits [`AsRef`] and [`AsMut`] provide similar methods for types that
2828
/// may not be fixed-size arrays. Implementors should prefer those traits
2929
/// instead.
30+
///
31+
/// [`AsRef`]: ../convert/trait.AsRef.html
32+
/// [`AsMut`]: ../convert/trait.AsMut.html
3033
#[unstable(feature = "fixed_size_array", issue = "27778")]
3134
pub unsafe trait FixedSizeArray<T> {
3235
/// Converts the array to immutable slice

src/libcore/convert.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ pub trait TryInto<T>: Sized {
427427
/// - [`try_from`] is reflexive, which means that `TryFrom<T> for T`
428428
/// is implemented and cannot fail -- the associated `Error` type for
429429
/// calling `T::try_from()` on a value of type `T` is [`Infallible`].
430-
/// When the [`!`] type is stablized [`Infallible`] and [`!`] will be
430+
/// When the [`!`] type is stabilized [`Infallible`] and [`!`] will be
431431
/// equivalent.
432432
///
433433
/// `TryFrom<T>` can be implemented as follows:

src/libcore/future/future.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ use crate::task::{Context, Poll};
1717
/// final value. This method does not block if the value is not ready. Instead,
1818
/// the current task is scheduled to be woken up when it's possible to make
1919
/// further progress by `poll`ing again. The `context` passed to the `poll`
20-
/// method can provide a `Waker`, which is a handle for waking up the current
20+
/// method can provide a [`Waker`], which is a handle for waking up the current
2121
/// task.
2222
///
2323
/// When using a future, you generally won't call `poll` directly, but instead
2424
/// `.await` the value.
25+
///
26+
/// [`Waker`]: ../task/struct.Waker.html
2527
#[doc(spotlight)]
2628
#[must_use = "futures do nothing unless you `.await` or poll them"]
2729
#[stable(feature = "futures_api", since = "1.36.0")]

src/libcore/mem/maybe_uninit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ impl<T> MaybeUninit<T> {
434434
/// Reads the value from the `MaybeUninit<T>` container. The resulting `T` is subject
435435
/// to the usual drop handling.
436436
///
437-
/// Whenever possible, it is preferrable to use [`assume_init`] instead, which
437+
/// Whenever possible, it is preferable to use [`assume_init`] instead, which
438438
/// prevents duplicating the content of the `MaybeUninit<T>`.
439439
///
440440
/// # Safety

src/libcore/ptr/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1611,7 +1611,7 @@ impl<T: ?Sized> *const T {
16111611
/// The offset is expressed in number of `T` elements, and not bytes. The value returned can be
16121612
/// used with the `add` method.
16131613
///
1614-
/// There are no guarantees whatsover that offsetting the pointer will not overflow or go
1614+
/// There are no guarantees whatsoever that offsetting the pointer will not overflow or go
16151615
/// beyond the allocation that the pointer points into. It is up to the caller to ensure that
16161616
/// the returned offset is correct in all terms other than alignment.
16171617
///
@@ -2412,7 +2412,7 @@ impl<T: ?Sized> *mut T {
24122412
/// The offset is expressed in number of `T` elements, and not bytes. The value returned can be
24132413
/// used with the `add` method.
24142414
///
2415-
/// There are no guarantees whatsover that offsetting the pointer will not overflow or go
2415+
/// There are no guarantees whatsoever that offsetting the pointer will not overflow or go
24162416
/// beyond the allocation that the pointer points into. It is up to the caller to ensure that
24172417
/// the returned offset is correct in all terms other than alignment.
24182418
///

src/librustc/traits/select.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ struct TraitObligationStack<'prev, 'tcx> {
167167
/// ok on the premise that if `A: AutoTrait` held, but we indeed
168168
/// encountered a problem (later on) with `A: AutoTrait. So we
169169
/// currently set a flag on the stack node for `B: AutoTrait` (as
170-
/// well as the second instance of `A: AutoTrait`) to supress
170+
/// well as the second instance of `A: AutoTrait`) to suppress
171171
/// caching.
172172
///
173173
/// This is a simple, targeted fix. A more-performant fix requires
@@ -1105,7 +1105,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
11051105
///
11061106
/// - is a defaulted trait,
11071107
/// - it also appears in the backtrace at some position `X`,
1108-
/// - all the predicates at positions `X..` between `X` an the top are
1108+
/// - all the predicates at positions `X..` between `X` and the top are
11091109
/// also defaulted traits.
11101110
pub fn coinductive_match<I>(&mut self, cycle: I) -> bool
11111111
where

src/libstd/ffi/c_str.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ impl CStr {
10551055
///
10561056
/// ```no_run
10571057
/// # #![allow(unused_must_use)]
1058-
/// use std::ffi::{CString};
1058+
/// use std::ffi::CString;
10591059
///
10601060
/// let ptr = CString::new("Hello").expect("CString::new failed").as_ptr();
10611061
/// unsafe {
@@ -1071,7 +1071,7 @@ impl CStr {
10711071
///
10721072
/// ```no_run
10731073
/// # #![allow(unused_must_use)]
1074-
/// use std::ffi::{CString};
1074+
/// use std::ffi::CString;
10751075
///
10761076
/// let hello = CString::new("Hello").expect("CString::new failed");
10771077
/// let ptr = hello.as_ptr();

src/libsyntax/parse/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ pub fn stream_to_parser_with_base_dir<'a>(
368368

369369
/// A sequence separator.
370370
pub struct SeqSep {
371-
/// The seperator token.
371+
/// The separator token.
372372
pub sep: Option<TokenKind>,
373373
/// `true` if a trailing separator is allowed.
374374
pub trailing_sep_allowed: bool,

0 commit comments

Comments
 (0)