Skip to content

Commit 59ccba9

Browse files
committed
Auto merge of #43939 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests - Successful merges: #43891, #43905, #43912, #43914, #43915, #43916, #43920, #43928, #43930 - Failed merges:
2 parents dd39ecf + 235fb23 commit 59ccba9

File tree

57 files changed

+129
-75
lines changed

Some content is hidden

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

57 files changed

+129
-75
lines changed

src/bootstrap/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ impl<'a> Builder<'a> {
257257
Kind::Bench => describe!(check::Crate, check::CrateLibrustc),
258258
Kind::Doc => describe!(doc::UnstableBook, doc::UnstableBookGen, doc::TheBook,
259259
doc::Standalone, doc::Std, doc::Test, doc::Rustc, doc::ErrorIndex, doc::Nomicon,
260-
doc::Reference, doc::Rustdoc),
260+
doc::Reference, doc::Rustdoc, doc::CargoBook),
261261
Kind::Dist => describe!(dist::Docs, dist::Mingw, dist::Rustc, dist::DebuggerScripts,
262262
dist::Std, dist::Analysis, dist::Src, dist::PlainSourceTarball, dist::Cargo,
263263
dist::Rls, dist::Extended, dist::HashSign),

src/bootstrap/doc.rs

+45
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,51 @@ impl Step for TheBook {
240240
}
241241
}
242242

243+
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
244+
pub struct CargoBook {
245+
target: Interned<String>,
246+
}
247+
248+
impl Step for CargoBook {
249+
type Output = ();
250+
const DEFAULT: bool = true;
251+
252+
fn should_run(run: ShouldRun) -> ShouldRun {
253+
let builder = run.builder;
254+
run.path("src/doc/cargo").default_condition(builder.build.config.docs)
255+
}
256+
257+
fn make_run(run: RunConfig) {
258+
run.builder.ensure(CargoBook {
259+
target: run.target,
260+
});
261+
}
262+
263+
/// Create a placeholder for the cargo documentation so that doc.rust-lang.org/cargo will
264+
/// redirect to doc.crates.io. We want to publish doc.rust-lang.org/cargo in the paper
265+
/// version of the book, but we don't want to rush the process of switching cargo's docs
266+
/// over to mdbook and deploying them. When the cargo book is ready, this implementation
267+
/// should build the mdbook instead of this redirect page.
268+
fn run(self, builder: &Builder) {
269+
let build = builder.build;
270+
let out = build.doc_out(self.target);
271+
272+
let cargo_dir = out.join("cargo");
273+
t!(fs::create_dir_all(&cargo_dir));
274+
275+
let index = cargo_dir.join("index.html");
276+
let redirect_html = r#"
277+
<html>
278+
<head>
279+
<meta http-equiv="refresh" content="0; URL='http://doc.crates.io'" />
280+
</head>
281+
</html>"#;
282+
283+
println!("Creating cargo book redirect page");
284+
t!(t!(File::create(&index)).write_all(redirect_html.as_bytes()));
285+
}
286+
}
287+
243288
fn invoke_rustdoc(builder: &Builder, compiler: Compiler, target: Interned<String>, markdown: &str) {
244289
let build = builder.build;
245290
let out = build.doc_out(target);

src/bootstrap/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ impl Build {
444444
}
445445

446446
/// Returns the root output directory for all Cargo output in a given stage,
447-
/// running a particular compiler, wehther or not we're building the
447+
/// running a particular compiler, whether or not we're building the
448448
/// standard library, and targeting the specified architecture.
449449
fn cargo_out(&self,
450450
compiler: Compiler,

src/bootstrap/native.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Compilation of native dependencies like LLVM.
1212
//!
1313
//! Native projects like LLVM unfortunately aren't suited just yet for
14-
//! compilation in build scripts that Cargo has. This is because thie
14+
//! compilation in build scripts that Cargo has. This is because the
1515
//! compilation takes a *very* long time but also because we don't want to
1616
//! compile LLVM 3 times as part of a normal bootstrap (we want it cached).
1717
//!

src/doc/book

Submodule book updated 53 files

src/doc/nomicon

src/liballoc/allocator.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ impl Layout {
293293
/// Creates a layout describing the record for `self` followed by
294294
/// `next` with no additional padding between the two. Since no
295295
/// padding is inserted, the alignment of `next` is irrelevant,
296-
/// and is not incoporated *at all* into the resulting layout.
296+
/// and is not incorporated *at all* into the resulting 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
@@ -528,7 +528,7 @@ pub unsafe trait Alloc {
528528
/// to allocate that block of memory.
529529
unsafe fn dealloc(&mut self, ptr: *mut u8, layout: Layout);
530530

531-
/// Allocator-specific method for signalling an out-of-memory
531+
/// Allocator-specific method for signaling an out-of-memory
532532
/// condition.
533533
///
534534
/// `oom` aborts the thread or process, optionally performing
@@ -539,7 +539,7 @@ pub unsafe trait Alloc {
539539
/// unsatisfied allocation request (signaled by an error such as
540540
/// `AllocErr::Exhausted`), and wish to abandon computation rather
541541
/// than attempt to recover locally. Such clients should pass the
542-
/// signalling error value back into `oom`, where the allocator
542+
/// signaling error value back into `oom`, where the allocator
543543
/// may incorporate that error value into its diagnostic report
544544
/// before aborting.
545545
///

src/liballoc/btree/node.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ impl<Node: Copy, Type> Clone for Handle<Node, Type> {
763763
}
764764

765765
impl<Node, Type> Handle<Node, Type> {
766-
/// Retrieves the node that contains the edge of key/value pair this handle pointes to.
766+
/// Retrieves the node that contains the edge of key/value pair this handle points to.
767767
pub fn into_node(self) -> Node {
768768
self.node
769769
}

src/liballoc/raw_vec.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,12 @@ impl<T, A: Alloc> RawVec<T, A> {
544544
/// Attempts to ensure that the buffer contains at least enough space to hold
545545
/// `used_cap + needed_extra_cap` elements. If it doesn't already have
546546
/// enough capacity, will reallocate in place enough space plus comfortable slack
547-
/// space to get amortized `O(1)` behaviour. Will limit this behaviour
547+
/// space to get amortized `O(1)` behavior. Will limit this behaviour
548548
/// if it would needlessly cause itself to panic.
549549
///
550550
/// If `used_cap` exceeds `self.cap()`, this may fail to actually allocate
551551
/// the requested space. This is not really unsafe, but the unsafe
552-
/// code *you* write that relies on the behaviour of this function may break.
552+
/// code *you* write that relies on the behavior of this function may break.
553553
///
554554
/// Returns true if the reallocation attempt has succeeded, or false otherwise.
555555
///

src/libcore/cell.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ impl<T: ?Sized> RefCell<T> {
809809
/// [`borrow_mut`] method instead if `self` isn't mutable.
810810
///
811811
/// Also, please be aware that this method is only for special circumstances and is usually
812-
/// not you want. In case of doubt, use [`borrow_mut`] instead.
812+
/// not what you want. In case of doubt, use [`borrow_mut`] instead.
813813
///
814814
/// [`borrow_mut`]: #method.borrow_mut
815815
///

src/libcore/hash/mod.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,12 @@ pub trait Hash {
240240
/// [`write_u8`]: #method.write_u8
241241
#[stable(feature = "rust1", since = "1.0.0")]
242242
pub trait Hasher {
243-
/// Completes a round of hashing, producing the output hash generated.
243+
/// Returns the hash value for the values written so far.
244+
///
245+
/// Despite its name, the method does not reset the hasher’s internal
246+
/// state. Additional [`write`]s will continue from the current value.
247+
/// If you need to start a fresh hash value, you will have to create
248+
/// a new hasher.
244249
///
245250
/// # Examples
246251
///
@@ -253,6 +258,8 @@ pub trait Hasher {
253258
///
254259
/// println!("Hash is {:x}!", hasher.finish());
255260
/// ```
261+
///
262+
/// ['write']: #tymethod.write
256263
#[stable(feature = "rust1", since = "1.0.0")]
257264
fn finish(&self) -> u64;
258265

src/libcore/num/dec2flt/rawfp.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ pub trait RawFloat : Float + Copy + Debug + LowerExp
102102
/// The number of bits in the exponent.
103103
const EXP_BITS: u8;
104104

105-
/// The number of bits in the singificand, *including* the hidden bit.
105+
/// The number of bits in the significand, *including* the hidden bit.
106106
const SIG_BITS: u8;
107107

108-
/// The number of bits in the singificand, *excluding* the hidden bit.
108+
/// The number of bits in the significand, *excluding* the hidden bit.
109109
const EXPLICIT_SIG_BITS: u8;
110110

111111
/// The maximum legal exponent in fractional representation.
@@ -123,7 +123,7 @@ pub trait RawFloat : Float + Copy + Debug + LowerExp
123123
/// `MIN_EXP` for integral representation, i.e., with the shift applied.
124124
const MIN_EXP_INT: i16;
125125

126-
/// The maximum normalized singificand in integral representation.
126+
/// The maximum normalized significand in integral representation.
127127
const MAX_SIG: u64;
128128

129129
/// The minimal normalized significand in integral representation.

src/libcore/ops/try.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
/// A trait for customizing the behaviour of the `?` operator.
11+
/// A trait for customizing the behavior of the `?` operator.
1212
///
1313
/// A type implementing `Try` is one that has a canonical way to view it
1414
/// in terms of a success/failure dichotomy. This trait allows both

src/libcore/sync/atomic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,7 @@ unsafe fn atomic_xor<T>(dst: *mut T, val: T, order: Ordering) -> T {
16321632
///
16331633
/// pub fn lock(&self) {
16341634
/// while !self.flag.compare_and_swap(false, true, Ordering::Relaxed) {}
1635-
/// // This fence syncronizes-with store in `unlock`.
1635+
/// // This fence synchronizes-with store in `unlock`.
16361636
/// fence(Ordering::Acquire);
16371637
/// }
16381638
///

src/libgraphviz/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Generate files suitable for use with [Graphviz](http://www.graphviz.org/)
1212
//!
1313
//! The `render` function generates output (e.g. an `output.dot` file) for
14-
//! use with [Graphviz](http://www.graphviz.org/) by walking a labelled
14+
//! use with [Graphviz](http://www.graphviz.org/) by walking a labeled
1515
//! graph. (Graphviz can then automatically lay out the nodes and edges
1616
//! of the graph, and also optionally render the graph as an image or
1717
//! other [output formats](
@@ -150,7 +150,7 @@
150150
//!
151151
//! The output from this example renders four nodes that make up the
152152
//! Hasse-diagram for the subsets of the set `{x, y}`. Each edge is
153-
//! labelled with the &sube; character (specified using the HTML character
153+
//! labeled with the &sube; character (specified using the HTML character
154154
//! entity `&sube`).
155155
//!
156156
//! ```rust
@@ -789,7 +789,7 @@ mod tests {
789789
}
790790

791791
struct LabelledGraph {
792-
/// The name for this graph. Used for labelling generated `digraph`.
792+
/// The name for this graph. Used for labeling generated `digraph`.
793793
name: &'static str,
794794

795795
/// Each node is an index into `node_labels`; these labels are

src/librand/distributions/gamma.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ impl IndependentSample<f64> for ChiSquared {
254254

255255
/// The Fisher F distribution `F(m, n)`.
256256
///
257-
/// This distribution is equivalent to the ratio of two normalised
257+
/// This distribution is equivalent to the ratio of two normalized
258258
/// chi-squared distributions, that is, `F(m,n) = (χ²(m)/m) /
259259
/// (χ²(n)/n)`.
260260
pub struct FisherF {

src/librand/isaac.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ impl IsaacRng {
7676
rng
7777
}
7878

79-
/// Initialises `self`. If `use_rsl` is true, then use the current value
79+
/// Initializes `self`. If `use_rsl` is true, then use the current value
8080
/// of `rsl` as a seed, otherwise construct one algorithmically (not
8181
/// randomly).
8282
fn init(&mut self, use_rsl: bool) {
@@ -367,7 +367,7 @@ impl Isaac64Rng {
367367
rng
368368
}
369369

370-
/// Initialises `self`. If `use_rsl` is true, then use the current value
370+
/// Initializes `self`. If `use_rsl` is true, then use the current value
371371
/// of `rsl` as a seed, otherwise construct one algorithmically (not
372372
/// randomly).
373373
fn init(&mut self, use_rsl: bool) {

src/librand/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub trait Rng: Sized {
180180
/// This method does *not* have a requirement to bear any fixed
181181
/// relationship to the other methods, for example, it does *not*
182182
/// have to result in the same output as progressively filling
183-
/// `dest` with `self.gen::<u8>()`, and any such behaviour should
183+
/// `dest` with `self.gen::<u8>()`, and any such behavior should
184184
/// not be relied upon.
185185
///
186186
/// This method should guarantee that `dest` is entirely filled

src/librand/reseeding.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct ReseedingRng<R, Rsdr> {
2424
rng: R,
2525
generation_threshold: usize,
2626
bytes_generated: usize,
27-
/// Controls the behaviour when reseeding the RNG.
27+
/// Controls the behavior when reseeding the RNG.
2828
pub reseeder: Rsdr,
2929
}
3030

src/librustc/diagnostics.rs

+4
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,10 @@ Here are some simple examples of where you'll run into this error:
362362
struct Foo { x: &bool } // error
363363
struct Foo<'a> { x: &'a bool } // correct
364364
365+
struct Bar { x: Foo }
366+
^^^ expected lifetime parameter
367+
struct Bar<'a> { x: Foo<'a> } // correct
368+
365369
enum Bar { A(u8), B(&bool), } // error
366370
enum Bar<'a> { A(u8), B(&'a bool), } // correct
367371

src/librustc/hir/map/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ impl<'hir> Map<'hir> {
731731

732732
/// Returns the nearest enclosing scope. A scope is an item or block.
733733
/// FIXME it is not clear to me that all items qualify as scopes - statics
734-
/// and associated types probably shouldn't, for example. Behaviour in this
734+
/// and associated types probably shouldn't, for example. Behavior in this
735735
/// regard should be expected to be highly unstable.
736736
pub fn get_enclosing_scope(&self, id: NodeId) -> Option<NodeId> {
737737
match self.walk_parent_nodes(id, |node| match *node {

src/librustc/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//! a span, but also more information so that we can generate a meaningful
2525
//! error message.
2626
//!
27-
//! Having a catalogue of all the different reasons an error can arise is
27+
//! Having a catalog of all the different reasons an error can arise is
2828
//! also useful for other reasons, like cross-referencing FAQs etc, though
2929
//! we are not really taking advantage of this yet.
3030
//!

src/librustc/infer/resolve.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for OpportunisticTypeResolver<'a, 'g
4646
}
4747

4848
/// The opportunistic type and region resolver is similar to the
49-
/// opportunistic type resolver, but also opportunistly resolves
49+
/// opportunistic type resolver, but also opportunistically resolves
5050
/// regions. It is useful for canonicalization.
5151
pub struct OpportunisticTypeAndRegionResolver<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
5252
infcx: &'a InferCtxt<'a, 'gcx, 'tcx>,

src/librustc/lint/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub struct FutureIncompatibleInfo {
101101
pub reference: &'static str // e.g., a URL for an issue/PR/RFC or error code
102102
}
103103

104-
/// The targed of the `by_name` map, which accounts for renaming/deprecation.
104+
/// The target of the `by_name` map, which accounts for renaming/deprecation.
105105
enum TargetLint {
106106
/// A direct lint target
107107
Id(LintId),

src/librustc/middle/region.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ use mir::transform::MirSource;
7272
/// (M1.): Misc extent of the whole `let a = ...;` statement.
7373
/// (M2.): Misc extent of the `f()` expression.
7474
/// (M3.): Misc extent of the `f().g(..)` expression.
75-
/// (M4.): Misc extent of the block labelled `'b:`.
75+
/// (M4.): Misc extent of the block labeled `'b:`.
7676
/// (M5.): Misc extent of the `let x = d();` statement
7777
/// (D6.): DestructionScope for temporaries created during M5.
7878
/// (R7.): Remainder extent for block `'b:`, stmt 0 (let x = ...).

src/librustc/mir/traversal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl<'a, 'tcx> Iterator for Postorder<'a, 'tcx> {
216216
///
217217
/// Reverse postorder is the reverse order of a postorder traversal.
218218
/// This is different to a preorder traversal and represents a natural
219-
/// linearisation of control-flow.
219+
/// linearization of control-flow.
220220
///
221221
/// ```text
222222
///

src/librustc/traits/fulfill.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl<'tcx> ForestObligation for PendingPredicateObligation<'tcx> {
3737
/// consists of a list of obligations that must be (eventually)
3838
/// satisfied. The job is to track which are satisfied, which yielded
3939
/// errors, and which are still pending. At any point, users can call
40-
/// `select_where_possible`, and the fulfilment context will try to do
40+
/// `select_where_possible`, and the fulfillment context will try to do
4141
/// selection, retaining only those obligations that remain
4242
/// ambiguous. This may be helpful in pushing type inference
4343
/// along. Once all type inference constraints have been generated, the

src/librustc/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ pub struct GlobalCtxt<'tcx> {
851851

852852
/// A vector of every trait accessible in the whole crate
853853
/// (i.e. including those from subcrates). This is used only for
854-
/// error reporting, and so is lazily initialised and generally
854+
/// error reporting, and so is lazily initialized and generally
855855
/// shouldn't taint the common path (hence the RefCell).
856856
pub all_traits: RefCell<Option<Vec<DefId>>>,
857857
}

src/librustc/ty/inhabitedness/def_id_forest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub struct DefIdForest {
2626
/// The minimal set of DefIds required to represent the whole set.
2727
/// If A and B are DefIds in the DefIdForest, and A is a descendant
2828
/// of B, then only B will be in root_ids.
29-
/// We use a SmallVec here because (for its use for cacheing inhabitedness)
29+
/// We use a SmallVec here because (for its use for caching inhabitedness)
3030
/// its rare that this will contain even two ids.
3131
root_ids: SmallVec<[DefId; 1]>,
3232
}

src/librustc/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ pub type Region<'tcx> = &'tcx RegionKind;
739739
///
740740
/// The process of doing that is called "skolemization". The bound regions
741741
/// are replaced by skolemized markers, which don't satisfy any relation
742-
/// not explicity provided.
742+
/// not explicitly provided.
743743
///
744744
/// There are 2 kinds of skolemized regions in rustc: `ReFree` and
745745
/// `ReSkolemized`. When checking an item's body, `ReFree` is supposed

src/librustc_data_structures/accumulate_vec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! Space for up to N elements is provided on the stack. If more elements are collected, Vec is
1414
//! used to store the values on the heap.
1515
//!
16-
//! The N above is determined by Array's implementor, by way of an associatated constant.
16+
//! The N above is determined by Array's implementor, by way of an associated constant.
1717
1818
use std::ops::{Deref, DerefMut};
1919
use std::iter::{self, IntoIterator, FromIterator};

src/librustc_data_structures/ivar.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::cell::Cell;
1414
/// A write-once variable. When constructed, it is empty, and
1515
/// can only be set once.
1616
///
17-
/// Ivars ensure that data that can only be initialised once. A full
17+
/// Ivars ensure that data that can only be initialized once. A full
1818
/// implementation is used for concurrency and blocks on a read of an
1919
/// unfulfilled value. This implementation is more minimal and panics
2020
/// if you attempt to read the value before it has been set. It is also

0 commit comments

Comments
 (0)