Skip to content

Commit b87363e

Browse files
author
Alexander Regueiro
committed
tests: doc comments
1 parent c3e182c commit b87363e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+164
-164
lines changed

src/liballoc/collections/btree/node.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ pub const CAPACITY: usize = 2 * B - 1;
5050
///
5151
/// We have a separate type for the header and rely on it matching the prefix of `LeafNode`, in
5252
/// order to statically allocate a single dummy node to avoid allocations. This struct is
53-
/// `repr(C)` to prevent them from being reordered. `LeafNode` does not just contain a
53+
/// `repr(C)` to prevent them from being reordered. `LeafNode` does not just contain a
5454
/// `NodeHeader` because we do not want unnecessary padding between `len` and the keys.
55-
/// Crucially, `NodeHeader` can be safely transmuted to different K and V. (This is exploited
55+
/// Crucially, `NodeHeader` can be safely transmuted to different K and V. (This is exploited
5656
/// by `as_header`.)
57-
/// See `into_key_slice` for an explanation of K2. K2 cannot be safely transmuted around
57+
/// See `into_key_slice` for an explanation of K2. K2 cannot be safely transmuted around
5858
/// because the size of `NodeHeader` depends on its alignment!
5959
#[repr(C)]
6060
struct NodeHeader<K, V, K2 = ()> {

src/liballoc/collections/vec_deque.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,7 @@ impl<T> VecDeque<T> {
19221922
///
19231923
/// # Panics
19241924
///
1925-
/// If `mid` is greater than `len()`. Note that `mid == len()`
1925+
/// If `mid` is greater than `len()`. Note that `mid == len()`
19261926
/// does _not_ panic and is a no-op rotation.
19271927
///
19281928
/// # Complexity
@@ -1967,7 +1967,7 @@ impl<T> VecDeque<T> {
19671967
///
19681968
/// # Panics
19691969
///
1970-
/// If `k` is greater than `len()`. Note that `k == len()`
1970+
/// If `k` is greater than `len()`. Note that `k == len()`
19711971
/// does _not_ panic and is a no-op rotation.
19721972
///
19731973
/// # Complexity

src/liballoc/fmt.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
//! will then parse the format string and determine if the list of arguments
2828
//! provided is suitable to pass to this format string.
2929
//!
30-
//! To convert a single value to a string, use the [`to_string`] method. This
30+
//! To convert a single value to a string, use the [`to_string`] method. This
3131
//! will use the [`Display`] formatting trait.
3232
//!
3333
//! ## Positional parameters
@@ -102,7 +102,7 @@
102102
//! When requesting that an argument be formatted with a particular type, you
103103
//! are actually requesting that an argument ascribes to a particular trait.
104104
//! This allows multiple actual types to be formatted via `{:x}` (like [`i8`] as
105-
//! well as [`isize`]). The current mapping of types to traits is:
105+
//! well as [`isize`]). The current mapping of types to traits is:
106106
//!
107107
//! * *nothing* ⇒ [`Display`]
108108
//! * `?` ⇒ [`Debug`]
@@ -427,7 +427,7 @@
427427
//! 3. An asterisk `.*`:
428428
//!
429429
//! `.*` means that this `{...}` is associated with *two* format inputs rather than one: the
430-
//! first input holds the `usize` precision, and the second holds the value to print. Note that
430+
//! first input holds the `usize` precision, and the second holds the value to print. Note that
431431
//! in this case, if one uses the format string `{<arg>:<spec>.*}`, then the `<arg>` part refers
432432
//! to the *value* to print, and the `precision` must come in the input preceding `<arg>`.
433433
//!

src/liballoc/macros.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ macro_rules! vec {
6262

6363
/// Creates a `String` using interpolation of runtime expressions.
6464
///
65-
/// The first argument `format!` receives is a format string. This must be a string
66-
/// literal. The power of the formatting string is in the `{}`s contained.
65+
/// The first argument `format!` receives is a format string. This must be a string
66+
/// literal. The power of the formatting string is in the `{}`s contained.
6767
///
6868
/// Additional parameters passed to `format!` replace the `{}`s within the
6969
/// formatting string in the order given unless named or positional parameters
@@ -73,7 +73,7 @@ macro_rules! vec {
7373
/// The same convention is used with [`print!`] and [`write!`] macros,
7474
/// depending on the intended destination of the string.
7575
///
76-
/// To convert a single value to a string, use the [`to_string`] method. This
76+
/// To convert a single value to a string, use the [`to_string`] method. This
7777
/// will use the [`Display`] formatting trait.
7878
///
7979
/// [fmt]: ../std/fmt/index.html

src/liballoc/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ impl<T> Vec<T> {
738738
/// Forces the length of the vector to `new_len`.
739739
///
740740
/// This is a low-level operation that maintains none of the normal
741-
/// invariants of the type. Normally changing the length of a vector
741+
/// invariants of the type. Normally changing the length of a vector
742742
/// is done using one of the safe operations instead, such as
743743
/// [`truncate`], [`resize`], [`extend`], or [`clear`].
744744
///

src/libcore/alloc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ impl fmt::Display for CannotReallocInPlace {
425425
/// The `GlobalAlloc` trait is an `unsafe` trait for a number of reasons, and
426426
/// implementors must ensure that they adhere to these contracts:
427427
///
428-
/// * It's undefined behavior if global allocators unwind. This restriction may
428+
/// * It's undefined behavior if global allocators unwind. This restriction may
429429
/// be lifted in the future, but currently a panic from any of these
430430
/// functions may lead to memory unsafety.
431431
///

src/libcore/any.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
//!
1919
//! Consider a situation where we want to log out a value passed to a function.
2020
//! We know the value we're working on implements Debug, but we don't know its
21-
//! concrete type. We want to give special treatment to certain types: in this
21+
//! concrete type. We want to give special treatment to certain types: in this
2222
//! case printing out the length of String values prior to their value.
2323
//! We don't know the concrete type of our value at compile time, so we need to
2424
//! use runtime reflection instead.
@@ -31,8 +31,8 @@
3131
//! fn log<T: Any + Debug>(value: &T) {
3232
//! let value_any = value as &dyn Any;
3333
//!
34-
//! // try to convert our value to a String. If successful, we want to
35-
//! // output the String's length as well as its value. If not, it's a
34+
//! // Try to convert our value to a `String`. If successful, we want to
35+
//! // output the String`'s length as well as its value. If not, it's a
3636
//! // different type: just print it out unadorned.
3737
//! match value_any.downcast_ref::<String>() {
3838
//! Some(as_string) => {

src/libcore/cell.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
11331133
/// The `RefCell` is already immutably borrowed, so this cannot fail.
11341134
///
11351135
/// This is an associated function that needs to be used as
1136-
/// `Ref::clone(...)`. A `Clone` implementation or a method would interfere
1136+
/// `Ref::clone(...)`. A `Clone` implementation or a method would interfere
11371137
/// with the widespread use of `r.borrow().clone()` to clone the contents of
11381138
/// a `RefCell`.
11391139
#[stable(feature = "cell_extras", since = "1.15.0")]
@@ -1174,7 +1174,7 @@ impl<'b, T: ?Sized> Ref<'b, T> {
11741174
}
11751175
}
11761176

1177-
/// Split a `Ref` into multiple `Ref`s for different components of the
1177+
/// Splits a `Ref` into multiple `Ref`s for different components of the
11781178
/// borrowed data.
11791179
///
11801180
/// The `RefCell` is already immutably borrowed, so this cannot fail.
@@ -1223,7 +1223,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
12231223
/// The `RefCell` is already mutably borrowed, so this cannot fail.
12241224
///
12251225
/// This is an associated function that needs to be used as
1226-
/// `RefMut::map(...)`. A method would interfere with methods of the same
1226+
/// `RefMut::map(...)`. A method would interfere with methods of the same
12271227
/// name on the contents of a `RefCell` used through `Deref`.
12281228
///
12291229
/// # Examples
@@ -1253,7 +1253,7 @@ impl<'b, T: ?Sized> RefMut<'b, T> {
12531253
}
12541254
}
12551255

1256-
/// Split a `RefMut` into multiple `RefMut`s for different components of the
1256+
/// Splits a `RefMut` into multiple `RefMut`s for different components of the
12571257
/// borrowed data.
12581258
///
12591259
/// The underlying `RefCell` will remain mutably borrowed until both

src/libcore/cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use self::Ordering::*;
2626
/// relations](http://en.wikipedia.org/wiki/Partial_equivalence_relation).
2727
///
2828
/// This trait allows for partial equality, for types that do not have a full
29-
/// equivalence relation. For example, in floating point numbers `NaN != NaN`,
29+
/// equivalence relation. For example, in floating point numbers `NaN != NaN`,
3030
/// so floating point types implement `PartialEq` but not `Eq`.
3131
///
3232
/// Formally, the equality must be (for all `a`, `b` and `c`):

src/libcore/convert.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub trait AsMut<T: ?Sized> {
217217
///
218218
/// There is one exception to implementing `Into`, and it's kind of esoteric.
219219
/// If the destination type is not part of the current crate, and it uses a
220-
/// generic variable, then you can't implement `From` directly. For example,
220+
/// generic variable, then you can't implement `From` directly. For example,
221221
/// take this crate:
222222
///
223223
/// ```compile_fail

0 commit comments

Comments
 (0)