Skip to content

Commit a80a873

Browse files
committed
Auto merge of #43839 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 8 pull requests - Successful merges: #43782, #43803, #43814, #43819, #43821, #43822, #43824, #43833 - Failed merges:
2 parents d4fbc7a + a7ead41 commit a80a873

File tree

63 files changed

+268
-175
lines changed

Some content is hidden

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

63 files changed

+268
-175
lines changed

src/bootstrap/builder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ impl<'a> Builder<'a> {
324324
StepDescription::run(&Builder::get_step_descriptions(Kind::Doc), self, paths);
325325
}
326326

327-
/// Obtain a compiler at a given stage and for a given host. Explictly does
327+
/// Obtain a compiler at a given stage and for a given host. Explicitly does
328328
/// not take `Compiler` since all `Compiler` instances are meant to be
329329
/// obtained through this function, since it ensures that they are valid
330330
/// (i.e., built and assembled).
@@ -489,7 +489,7 @@ impl<'a> Builder<'a> {
489489
// crates). Let's say, for example that rustc itself depends on the
490490
// bitflags crate. If an external crate then depends on the
491491
// bitflags crate as well, we need to make sure they don't
492-
// conflict, even if they pick the same verison of bitflags. We'll
492+
// conflict, even if they pick the same version of bitflags. We'll
493493
// want to make sure that e.g. a plugin and rustc each get their
494494
// own copy of bitflags.
495495

src/bootstrap/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl Step for Standalone {
306306
///
307307
/// This will list all of `src/doc` looking for markdown files and appropriately
308308
/// perform transformations like substituting `VERSION`, `SHORT_HASH`, and
309-
/// `STAMP` alongw ith providing the various header/footer HTML we've cutomized.
309+
/// `STAMP` along with providing the various header/footer HTML we've customized.
310310
///
311311
/// In the end, this is just a glorified wrapper around rustdoc!
312312
fn run(self, builder: &Builder) {

src/liballoc/allocator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ impl Layout {
240240
///
241241
/// Returns `Some((k, offset))`, where `k` is layout of the concatenated
242242
/// record and `offset` is the relative location, in bytes, of the
243-
/// start of the `next` embedded witnin the concatenated record
243+
/// start of the `next` embedded within the concatenated record
244244
/// (assuming that the record itself starts at offset 0).
245245
///
246246
/// On arithmetic overflow, returns `None`.
@@ -297,7 +297,7 @@ impl Layout {
297297
///
298298
/// Returns `(k, offset)`, where `k` is layout of the concatenated
299299
/// record and `offset` is the relative location, in bytes, of the
300-
/// start of the `next` embedded witnin the concatenated record
300+
/// start of the `next` embedded within the concatenated record
301301
/// (assuming that the record itself starts at offset 0).
302302
///
303303
/// (The `offset` is always the same as `self.size()`; we use this
@@ -544,7 +544,7 @@ pub unsafe trait Alloc {
544544
/// practice this means implementors should eschew allocating,
545545
/// especially from `self` (directly or indirectly).
546546
///
547-
/// Implementions of the allocation and reallocation methods
547+
/// Implementations of the allocation and reallocation methods
548548
/// (e.g. `alloc`, `alloc_one`, `realloc`) are discouraged from
549549
/// panicking (or aborting) in the event of memory exhaustion;
550550
/// instead they should return an appropriate error from the

src/liballoc/fmt.rs

+62-37
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
//! Utilities for formatting and printing `String`s
1212
//!
13-
//! This module contains the runtime support for the `format!` syntax extension.
13+
//! This module contains the runtime support for the [`format!`] syntax extension.
1414
//! This macro is implemented in the compiler to emit calls to this module in
1515
//! order to format arguments at runtime into strings.
1616
//!
1717
//! # Usage
1818
//!
19-
//! The `format!` macro is intended to be familiar to those coming from C's
20-
//! printf/fprintf functions or Python's `str.format` function.
19+
//! The [`format!`] macro is intended to be familiar to those coming from C's
20+
//! `printf`/`fprintf` functions or Python's `str.format` function.
2121
//!
22-
//! Some examples of the `format!` extension are:
22+
//! Some examples of the [`format!`] extension are:
2323
//!
2424
//! ```
2525
//! format!("Hello"); // => "Hello"
@@ -67,15 +67,15 @@
6767
//! ## Named parameters
6868
//!
6969
//! Rust itself does not have a Python-like equivalent of named parameters to a
70-
//! function, but the `format!` macro is a syntax extension which allows it to
70+
//! function, but the [`format!`] macro is a syntax extension which allows it to
7171
//! leverage named parameters. Named parameters are listed at the end of the
7272
//! argument list and have the syntax:
7373
//!
7474
//! ```text
7575
//! identifier '=' expression
7676
//! ```
7777
//!
78-
//! For example, the following `format!` expressions all use named argument:
78+
//! For example, the following [`format!`] expressions all use named argument:
7979
//!
8080
//! ```
8181
//! format!("{argument}", argument = "test"); // => "test"
@@ -102,30 +102,30 @@
102102
//!
103103
//! If this syntax is used, then the number of characters to print precedes the
104104
//! actual object being formatted, and the number of characters must have the
105-
//! type `usize`.
105+
//! type [`usize`].
106106
//!
107107
//! ## Formatting traits
108108
//!
109109
//! When requesting that an argument be formatted with a particular type, you
110110
//! are actually requesting that an argument ascribes to a particular trait.
111-
//! This allows multiple actual types to be formatted via `{:x}` (like `i8` as
112-
//! well as `isize`). The current mapping of types to traits is:
111+
//! This allows multiple actual types to be formatted via `{:x}` (like [`i8`] as
112+
//! well as [`isize`]). The current mapping of types to traits is:
113113
//!
114-
//! * *nothing* ⇒ [`Display`](trait.Display.html)
115-
//! * `?` ⇒ [`Debug`](trait.Debug.html)
114+
//! * *nothing* ⇒ [`Display`]
115+
//! * `?` ⇒ [`Debug`]
116116
//! * `o` ⇒ [`Octal`](trait.Octal.html)
117117
//! * `x` ⇒ [`LowerHex`](trait.LowerHex.html)
118118
//! * `X` ⇒ [`UpperHex`](trait.UpperHex.html)
119119
//! * `p` ⇒ [`Pointer`](trait.Pointer.html)
120-
//! * `b` ⇒ [`Binary`](trait.Binary.html)
120+
//! * `b` ⇒ [`Binary`]
121121
//! * `e` ⇒ [`LowerExp`](trait.LowerExp.html)
122122
//! * `E` ⇒ [`UpperExp`](trait.UpperExp.html)
123123
//!
124124
//! What this means is that any type of argument which implements the
125-
//! `fmt::Binary` trait can then be formatted with `{:b}`. Implementations
125+
//! [`fmt::Binary`][`Binary`] trait can then be formatted with `{:b}`. Implementations
126126
//! are provided for these traits for a number of primitive types by the
127127
//! standard library as well. If no format is specified (as in `{}` or `{:6}`),
128-
//! then the format trait used is the `Display` trait.
128+
//! then the format trait used is the [`Display`] trait.
129129
//!
130130
//! When implementing a format trait for your own type, you will have to
131131
//! implement a method of the signature:
@@ -144,15 +144,15 @@
144144
//! should emit output into the `f.buf` stream. It is up to each format trait
145145
//! implementation to correctly adhere to the requested formatting parameters.
146146
//! The values of these parameters will be listed in the fields of the
147-
//! `Formatter` struct. In order to help with this, the `Formatter` struct also
147+
//! [`Formatter`] struct. In order to help with this, the [`Formatter`] struct also
148148
//! provides some helper methods.
149149
//!
150-
//! Additionally, the return value of this function is `fmt::Result` which is a
151-
//! type alias of `Result<(), std::fmt::Error>`. Formatting implementations
152-
//! should ensure that they propagate errors from the `Formatter` (e.g., when
153-
//! calling `write!`) however, they should never return errors spuriously. That
150+
//! Additionally, the return value of this function is [`fmt::Result`] which is a
151+
//! type alias of [`Result`]`<(), `[`std::fmt::Error`]`>`. Formatting implementations
152+
//! should ensure that they propagate errors from the [`Formatter`][`Formatter`] (e.g., when
153+
//! calling [`write!`]) however, they should never return errors spuriously. That
154154
//! is, a formatting implementation must and may only return an error if the
155-
//! passed-in `Formatter` returns an error. This is because, contrary to what
155+
//! passed-in [`Formatter`] returns an error. This is because, contrary to what
156156
//! the function signature might suggest, string formatting is an infallible
157157
//! operation. This function only returns a result because writing to the
158158
//! underlying stream might fail and it must provide a way to propagate the fact
@@ -209,12 +209,12 @@
209209
//!
210210
//! These two formatting traits have distinct purposes:
211211
//!
212-
//! - `fmt::Display` implementations assert that the type can be faithfully
212+
//! - [`fmt::Display`][`Display`] implementations assert that the type can be faithfully
213213
//! represented as a UTF-8 string at all times. It is **not** expected that
214214
//! all types implement the `Display` trait.
215-
//! - `fmt::Debug` implementations should be implemented for **all** public types.
215+
//! - [`fmt::Debug`][`Debug`] implementations should be implemented for **all** public types.
216216
//! Output will typically represent the internal state as faithfully as possible.
217-
//! The purpose of the `Debug` trait is to facilitate debugging Rust code. In
217+
//! The purpose of the [`Debug`] trait is to facilitate debugging Rust code. In
218218
//! most cases, using `#[derive(Debug)]` is sufficient and recommended.
219219
//!
220220
//! Some examples of the output from both traits:
@@ -227,7 +227,7 @@
227227
//!
228228
//! ## Related macros
229229
//!
230-
//! There are a number of related macros in the `format!` family. The ones that
230+
//! There are a number of related macros in the [`format!`] family. The ones that
231231
//! are currently implemented are:
232232
//!
233233
//! ```ignore (only-for-syntax-highlight)
@@ -241,11 +241,11 @@
241241
//!
242242
//! ### `write!`
243243
//!
244-
//! This and `writeln` are two macros which are used to emit the format string
244+
//! This and [`writeln!`] are two macros which are used to emit the format string
245245
//! to a specified stream. This is used to prevent intermediate allocations of
246246
//! format strings and instead directly write the output. Under the hood, this
247-
//! function is actually invoking the `write_fmt` function defined on the
248-
//! `std::io::Write` trait. Example usage is:
247+
//! function is actually invoking the [`write_fmt`] function defined on the
248+
//! [`std::io::Write`] trait. Example usage is:
249249
//!
250250
//! ```
251251
//! # #![allow(unused_must_use)]
@@ -256,7 +256,7 @@
256256
//!
257257
//! ### `print!`
258258
//!
259-
//! This and `println` emit their output to stdout. Similarly to the `write!`
259+
//! This and [`println!`] emit their output to stdout. Similarly to the [`write!`]
260260
//! macro, the goal of these macros is to avoid intermediate allocations when
261261
//! printing output. Example usage is:
262262
//!
@@ -288,8 +288,8 @@
288288
//! my_fmt_fn(format_args!(", or a {} too", "function"));
289289
//! ```
290290
//!
291-
//! The result of the `format_args!` macro is a value of type `fmt::Arguments`.
292-
//! This structure can then be passed to the `write` and `format` functions
291+
//! The result of the [`format_args!`] macro is a value of type [`fmt::Arguments`].
292+
//! This structure can then be passed to the [`write`] and [`format`] functions
293293
//! inside this module in order to process the format string.
294294
//! The goal of this macro is to even further prevent intermediate allocations
295295
//! when dealing formatting strings.
@@ -357,7 +357,7 @@
357357
//! * `-` - Currently not used
358358
//! * `#` - This flag is indicates that the "alternate" form of printing should
359359
//! be used. The alternate forms are:
360-
//! * `#?` - pretty-print the `Debug` formatting
360+
//! * `#?` - pretty-print the [`Debug`] formatting
361361
//! * `#x` - precedes the argument with a `0x`
362362
//! * `#X` - precedes the argument with a `0x`
363363
//! * `#b` - precedes the argument with a `0b`
@@ -384,9 +384,9 @@
384384
//! the `0` flag is specified for numerics, then the implicit fill character is
385385
//! `0`.
386386
//!
387-
//! The value for the width can also be provided as a `usize` in the list of
387+
//! The value for the width can also be provided as a [`usize`] in the list of
388388
//! parameters by using the dollar syntax indicating that the second argument is
389-
//! a `usize` specifying the width, for example:
389+
//! a [`usize`] specifying the width, for example:
390390
//!
391391
//! ```
392392
//! // All of these print "Hello x !"
@@ -474,6 +474,29 @@
474474
//! The literal characters `{` and `}` may be included in a string by preceding
475475
//! them with the same character. For example, the `{` character is escaped with
476476
//! `{{` and the `}` character is escaped with `}}`.
477+
//!
478+
//! [`format!`]: ../../macro.format.html
479+
//! [`usize`]: ../../std/primitive.usize.html
480+
//! [`isize`]: ../../std/primitive.isize.html
481+
//! [`i8`]: ../../std/primitive.i8.html
482+
//! [`Display`]: trait.Display.html
483+
//! [`Binary`]: trait.Binary.html
484+
//! [`fmt::Result`]: type.Result.html
485+
//! [`Result`]: ../../std/result/enum.Result.html
486+
//! [`std::fmt::Error`]: struct.Error.html
487+
//! [`Formatter`]: struct.Formatter.html
488+
//! [`write!`]: ../../std/macro.write.html
489+
//! [`Debug`]: trait.Debug.html
490+
//! [`format!`]: ../../std/macro.format.html
491+
//! [`writeln!`]: ../../std/macro.writeln.html
492+
//! [`write_fmt`]: ../../std/io/trait.Write.html#method.write_fmt
493+
//! [`std::io::Write`]: ../../std/io/trait.Write.html
494+
//! [`println!`]: ../../std/macro.println.html
495+
//! [`write!`]: ../../std/macro.write.html
496+
//! [`format_args!`]: ../../std/macro.format_args.html
497+
//! [`fmt::Arguments`]: struct.Arguments.html
498+
//! [`write`]: fn.write.html
499+
//! [`format`]: fn.format.html
477500
478501
#![stable(feature = "rust1", since = "1.0.0")]
479502

@@ -498,10 +521,10 @@ pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple};
498521

499522
use string;
500523

501-
/// The `format` function takes an `Arguments` struct and returns the resulting
524+
/// The `format` function takes an [`Arguments`] struct and returns the resulting
502525
/// formatted string.
503526
///
504-
/// The `Arguments` instance can be created with the `format_args!` macro.
527+
/// The [`Arguments`] instance can be created with the [`format_args!`] macro.
505528
///
506529
/// # Examples
507530
///
@@ -514,15 +537,17 @@ use string;
514537
/// assert_eq!(s, "Hello, world!");
515538
/// ```
516539
///
517-
/// Please note that using [`format!`][format!] might be preferrable.
540+
/// Please note that using [`format!`] might be preferrable.
518541
/// Example:
519542
///
520543
/// ```
521544
/// let s = format!("Hello, {}!", "world");
522545
/// assert_eq!(s, "Hello, world!");
523546
/// ```
524547
///
525-
/// [format!]: ../macro.format.html
548+
/// [`Arguments`]: struct.Arguments.html
549+
/// [`format_args!`]: ../../std/macro.format_args.html
550+
/// [`format!`]: ../../std/macro.format.html
526551
#[stable(feature = "rust1", since = "1.0.0")]
527552
pub fn format(args: Arguments) -> string::String {
528553
let capacity = args.estimated_capacity();

src/liballoc/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ impl String {
653653
/// * `capacity` needs to be the correct value.
654654
///
655655
/// Violating these may cause problems like corrupting the allocator's
656-
/// internal datastructures.
656+
/// internal data structures.
657657
///
658658
/// The ownership of `ptr` is effectively transferred to the
659659
/// `String` which may then deallocate, reallocate or change the

src/liballoc/vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ impl<T> Vec<T> {
374374
/// * `capacity` needs to be the capacity that the pointer was allocated with.
375375
///
376376
/// Violating these may cause problems like corrupting the allocator's
377-
/// internal datastructures. For example it is **not** safe
377+
/// internal data structures. For example it is **not** safe
378378
/// to build a `Vec<u8>` from a pointer to a C `char` array and a `size_t`.
379379
///
380380
/// The ownership of `ptr` is effectively transferred to the

src/libcore/ops/place.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub trait Place<Data: ?Sized> {
6666
/// or `Copy`, since the `make_place` method takes `self` by value.
6767
#[unstable(feature = "placement_new_protocol", issue = "27779")]
6868
pub trait Placer<Data: ?Sized> {
69-
/// `Place` is the intermedate agent guarding the
69+
/// `Place` is the intermediate agent guarding the
7070
/// uninitialized state for `Data`.
7171
type Place: InPlace<Data>;
7272

src/libgraphviz/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ impl<'a> LabelText<'a> {
548548
}
549549

550550
/// Renders text as string suitable for a label in a .dot file.
551-
/// This includes quotes or suitable delimeters.
551+
/// This includes quotes or suitable delimiters.
552552
pub fn to_dot_string(&self) -> String {
553553
match self {
554554
&LabelStr(ref s) => format!("\"{}\"", s.escape_default()),

src/librustc/hir/intravisit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub enum NestedVisitorMap<'this, 'tcx: 'this> {
8787
/// Do not visit nested item-like things, but visit nested things
8888
/// that are inside of an item-like.
8989
///
90-
/// **This is the most common choice.** A very commmon pattern is
90+
/// **This is the most common choice.** A very common pattern is
9191
/// to use `visit_all_item_likes()` as an outer loop,
9292
/// and to have the visitor that visits the contents of each item
9393
/// using this setting.

src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ pub struct Map<'hir> {
248248
pub forest: &'hir Forest,
249249

250250
/// Same as the dep_graph in forest, just available with one fewer
251-
/// deref. This is a gratuitious micro-optimization.
251+
/// deref. This is a gratuitous micro-optimization.
252252
pub dep_graph: DepGraph,
253253

254254
/// NodeIds are sequential integers from 0, so we can be

src/librustc/hir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ impl Crate {
496496
&self.impl_items[&id]
497497
}
498498

499-
/// Visits all items in the crate in some determinstic (but
499+
/// Visits all items in the crate in some deterministic (but
500500
/// unspecified) order. If you just need to process every item,
501501
/// but don't care about nesting, this method is the best choice.
502502
///

src/librustc/infer/at.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl<'a, 'gcx, 'tcx> At<'a, 'gcx, 'tcx> {
169169
}
170170

171171
/// Sets the "trace" values that will be used for
172-
/// error-repporting, but doesn't actually perform any operation
172+
/// error-reporting, but doesn't actually perform any operation
173173
/// yet (this is useful when you want to set the trace using
174174
/// distinct values from those you wish to operate upon).
175175
pub fn trace<T>(self,

src/librustc/infer/higher_ranked/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
589589
(result, map)
590590
}
591591

592-
/// Searches the region constriants created since `snapshot` was started
592+
/// Searches the region constraints created since `snapshot` was started
593593
/// and checks to determine whether any of the skolemized regions created
594594
/// in `skol_map` would "escape" -- meaning that they are related to
595595
/// other regions in some way. If so, the higher-ranked subtyping doesn't

src/librustc/infer/lattice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub trait LatticeDir<'f, 'gcx: 'f+'tcx, 'tcx: 'f> : TypeRelation<'f, 'gcx, 'tcx>
4646
// the LUB/GLB of `a` and `b` as appropriate.
4747
//
4848
// Subtle hack: ordering *may* be significant here. This method
49-
// relates `v` to `a` first, which may help us to avoid unecessary
49+
// relates `v` to `a` first, which may help us to avoid unnecessary
5050
// type variable obligations. See caller for details.
5151
fn relate_bound(&mut self, v: Ty<'tcx>, a: Ty<'tcx>, b: Ty<'tcx>) -> RelateResult<'tcx, ()>;
5252
}

src/librustc/infer/region_inference/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub enum UndoLogEntry<'tcx> {
128128
/// We added the given `given`
129129
AddGiven(Region<'tcx>, ty::RegionVid),
130130

131-
/// We added a GLB/LUB "combinaton variable"
131+
/// We added a GLB/LUB "combination variable"
132132
AddCombination(CombineMapType, TwoRegions<'tcx>),
133133

134134
/// During skolemization, we sometimes purge entries from the undo

0 commit comments

Comments
 (0)