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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 45 additions & 0 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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
///

0 commit comments

Comments
 (0)