Skip to content

Commit 871338c

Browse files
committed
Merging master
2 parents 1ef34a5 + 0f949c2 commit 871338c

File tree

1,347 files changed

+17717
-14504
lines changed

Some content is hidden

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

1,347 files changed

+17717
-14504
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@
4444
path = src/llvm-project
4545
url = https://github.com/rust-lang/llvm-project.git
4646
branch = rustc/8.0-2019-01-16
47+
[submodule "src/doc/embedded-book"]
48+
path = src/doc/embedded-book
49+
url = https://github.com/rust-embedded/book.git

.mailmap

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ Matt Brubeck <[email protected]> <[email protected]>
155155
Matthew Auld <[email protected]>
156156
157157
Matthijs Hofstra <[email protected]>
158+
158159
Michael Williams <[email protected]>
159160
Michael Woerister <michaelwoerister@posteo> <michaelwoerister@gmail>
160161
Mickaël Raybaud-Roig <[email protected]> m-r-r <[email protected]>

Cargo.lock

+34-32
Large diffs are not rendered by default.

src/bootstrap/builder.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,17 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash {
6060
/// Run this rule for all hosts without cross compiling.
6161
const ONLY_HOSTS: bool = false;
6262

63-
/// Primary function to execute this rule. Can call `builder.ensure(...)`
63+
/// Primary function to execute this rule. Can call `builder.ensure()`
6464
/// with other steps to run those.
6565
fn run(self, builder: &Builder) -> Self::Output;
6666

6767
/// When bootstrap is passed a set of paths, this controls whether this rule
6868
/// will execute. However, it does not get called in a "default" context
69-
/// when we are not passed any paths; in that case, make_run is called
69+
/// when we are not passed any paths; in that case, `make_run` is called
7070
/// directly.
7171
fn should_run(run: ShouldRun) -> ShouldRun;
7272

73-
/// Build up a "root" rule, either as a default rule or from a path passed
73+
/// Builds up a "root" rule, either as a default rule or from a path passed
7474
/// to us.
7575
///
7676
/// When path is `None`, we are executing in a context where no paths were
@@ -400,6 +400,7 @@ impl<'a> Builder<'a> {
400400
test::TheBook,
401401
test::UnstableBook,
402402
test::RustcBook,
403+
test::EmbeddedBook,
403404
test::Rustfmt,
404405
test::Miri,
405406
test::Clippy,
@@ -430,6 +431,7 @@ impl<'a> Builder<'a> {
430431
doc::RustByExample,
431432
doc::RustcBook,
432433
doc::CargoBook,
434+
doc::EmbeddedBook,
433435
doc::EditionGuide,
434436
),
435437
Kind::Dist => describe!(
@@ -646,7 +648,7 @@ impl<'a> Builder<'a> {
646648
add_lib_path(vec![self.rustc_libdir(compiler)], cmd);
647649
}
648650

649-
/// Get a path to the compiler specified.
651+
/// Gets a path to the compiler specified.
650652
pub fn rustc(&self, compiler: Compiler) -> PathBuf {
651653
if compiler.is_snapshot(self) {
652654
self.initial_rustc.clone()
@@ -657,7 +659,7 @@ impl<'a> Builder<'a> {
657659
}
658660
}
659661

660-
/// Get the paths to all of the compiler's codegen backends.
662+
/// Gets the paths to all of the compiler's codegen backends.
661663
fn codegen_backends(&self, compiler: Compiler) -> impl Iterator<Item = PathBuf> {
662664
fs::read_dir(self.sysroot_codegen_backends(compiler))
663665
.into_iter()
@@ -1017,8 +1019,7 @@ impl<'a> Builder<'a> {
10171019

10181020
cargo.env("RUSTC_VERBOSE", self.verbosity.to_string());
10191021

1020-
// in std, we want to avoid denying warnings for stage 0 as that makes cfg's painful.
1021-
if self.config.deny_warnings && !(mode == Mode::Std && stage == 0) {
1022+
if self.config.deny_warnings {
10221023
cargo.env("RUSTC_DENY_WARNINGS", "1");
10231024
}
10241025

src/bootstrap/cache.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,10 @@ lazy_static! {
227227
pub static ref INTERNER: Interner = Interner::default();
228228
}
229229

230-
/// This is essentially a HashMap which allows storing any type in its input and
230+
/// This is essentially a `HashMap` which allows storing any type in its input and
231231
/// any type in its output. It is a write-once cache; values are never evicted,
232232
/// which means that references to the value can safely be returned from the
233-
/// get() method.
233+
/// `get()` method.
234234
#[derive(Debug)]
235235
pub struct Cache(
236236
RefCell<HashMap<

src/bootstrap/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl Step for Rustc {
6666
});
6767
}
6868

69-
/// Build the compiler.
69+
/// Builds the compiler.
7070
///
7171
/// This will build the compiler for a particular stage of the build using
7272
/// the `compiler` targeting the `target` architecture. The artifacts

src/bootstrap/clean.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! Responsible for cleaning out a build directory of all old and stale
44
//! artifacts to prepare for a fresh build. Currently doesn't remove the
55
//! `build/cache` directory (download cache) or the `build/$target/llvm`
6-
//! directory unless the --all flag is present.
6+
//! directory unless the `--all` flag is present.
77
88
use std::fs;
99
use std::io::{self, ErrorKind};

src/bootstrap/compile.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl Step for Std {
4848
});
4949
}
5050

51-
/// Build the standard library.
51+
/// Builds the standard library.
5252
///
5353
/// This will build the standard library for a particular stage of the build
5454
/// using the `compiler` targeting the `target` architecture. The artifacts
@@ -269,7 +269,7 @@ impl Step for StartupObjects {
269269
});
270270
}
271271

272-
/// Build and prepare startup objects like rsbegin.o and rsend.o
272+
/// Builds and prepare startup objects like rsbegin.o and rsend.o
273273
///
274274
/// These are primarily used on Windows right now for linking executables/dlls.
275275
/// They don't require any library support as they're just plain old object
@@ -334,7 +334,7 @@ impl Step for Test {
334334
});
335335
}
336336

337-
/// Build libtest.
337+
/// Builds libtest.
338338
///
339339
/// This will build libtest and supporting libraries for a particular stage of
340340
/// the build using the `compiler` targeting the `target` architecture. The
@@ -455,7 +455,7 @@ impl Step for Rustc {
455455
});
456456
}
457457

458-
/// Build the compiler.
458+
/// Builds the compiler.
459459
///
460460
/// This will build the compiler for a particular stage of the build using
461461
/// the `compiler` targeting the `target` architecture. The artifacts

src/bootstrap/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl Step for Mingw {
342342
run.builder.ensure(Mingw { host: run.target });
343343
}
344344

345-
/// Build the `rust-mingw` installer component.
345+
/// Builds the `rust-mingw` installer component.
346346
///
347347
/// This contains all the bits and pieces to run the MinGW Windows targets
348348
/// without any extra installed software (e.g., we bundle gcc, libraries, etc).

src/bootstrap/doc.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ macro_rules! book {
6161
// adding a build step in `src/bootstrap/builder.rs`!
6262
book!(
6363
EditionGuide, "src/doc/edition-guide", "edition-guide", RustbookVersion::MdBook1;
64+
EmbeddedBook, "src/doc/embedded-book", "embedded-book", RustbookVersion::MdBook2;
6465
Nomicon, "src/doc/nomicon", "nomicon", RustbookVersion::MdBook1;
6566
Reference, "src/doc/reference", "reference", RustbookVersion::MdBook1;
6667
RustByExample, "src/doc/rust-by-example", "rust-by-example", RustbookVersion::MdBook1;
@@ -71,10 +72,6 @@ book!(
7172
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
7273
enum RustbookVersion {
7374
MdBook1,
74-
75-
/// Note: Currently no books use mdBook v2, but we want the option
76-
/// to be available
77-
#[allow(dead_code)]
7875
MdBook2,
7976
}
8077

@@ -262,7 +259,7 @@ impl Step for TheBook {
262259
});
263260
}
264261

265-
/// Build the book and associated stuff.
262+
/// Builds the book and associated stuff.
266263
///
267264
/// We need to build:
268265
///
@@ -614,7 +611,7 @@ impl Step for WhitelistedRustc {
614611
});
615612
}
616613

617-
/// Generate whitelisted compiler crate documentation.
614+
/// Generates whitelisted compiler crate documentation.
618615
///
619616
/// This will generate all documentation for crates that are whitelisted
620617
/// to be included in the standard documentation. This documentation is
@@ -686,7 +683,7 @@ impl Step for Rustc {
686683
});
687684
}
688685

689-
/// Generate compiler documentation.
686+
/// Generates compiler documentation.
690687
///
691688
/// This will generate all documentation for compiler and dependencies.
692689
/// Compiler documentation is distributed separately, so we make sure
@@ -787,7 +784,7 @@ impl Step for Rustdoc {
787784
});
788785
}
789786

790-
/// Generate compiler documentation.
787+
/// Generates compiler documentation.
791788
///
792789
/// This will generate all documentation for compiler and dependencies.
793790
/// Compiler documentation is distributed separately, so we make sure

src/bootstrap/lib.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
//! ## Copying stage0 {std,test,rustc}
7070
//!
7171
//! This copies the build output from Cargo into
72-
//! `build/$HOST/stage0-sysroot/lib/rustlib/$ARCH/lib`. FIXME: This step's
72+
//! `build/$HOST/stage0-sysroot/lib/rustlib/$ARCH/lib`. FIXME: this step's
7373
//! documentation should be expanded -- the information already here may be
7474
//! incorrect.
7575
//!
@@ -504,7 +504,7 @@ impl Build {
504504
cleared
505505
}
506506

507-
/// Get the space-separated set of activated features for the standard
507+
/// Gets the space-separated set of activated features for the standard
508508
/// library.
509509
fn std_features(&self) -> String {
510510
let mut features = "panic-unwind".to_string();
@@ -521,7 +521,7 @@ impl Build {
521521
features
522522
}
523523

524-
/// Get the space-separated set of activated features for the compiler.
524+
/// Gets the space-separated set of activated features for the compiler.
525525
fn rustc_features(&self) -> String {
526526
let mut features = String::new();
527527
if self.config.jemalloc {
@@ -609,7 +609,7 @@ impl Build {
609609
self.out.join(&*target).join("crate-docs")
610610
}
611611

612-
/// Returns true if no custom `llvm-config` is set for the specified target.
612+
/// Returns `true` if no custom `llvm-config` is set for the specified target.
613613
///
614614
/// If no custom `llvm-config` was specified then Rust's llvm will be used.
615615
fn is_rust_llvm(&self, target: Interned<String>) -> bool {
@@ -857,13 +857,13 @@ impl Build {
857857
.map(|p| &**p)
858858
}
859859

860-
/// Returns true if this is a no-std `target`, if defined
860+
/// Returns `true` if this is a no-std `target`, if defined
861861
fn no_std(&self, target: Interned<String>) -> Option<bool> {
862862
self.config.target_config.get(&target)
863863
.map(|t| t.no_std)
864864
}
865865

866-
/// Returns whether the target will be tested using the `remote-test-client`
866+
/// Returns `true` if the target will be tested using the `remote-test-client`
867867
/// and `remote-test-server` binaries.
868868
fn remote_tested(&self, target: Interned<String>) -> bool {
869869
self.qemu_rootfs(target).is_some() || target.contains("android") ||
@@ -1059,7 +1059,7 @@ impl Build {
10591059
self.rust_info.version(self, channel::CFG_RELEASE_NUM)
10601060
}
10611061

1062-
/// Return the full commit hash
1062+
/// Returns the full commit hash.
10631063
fn rust_sha(&self) -> Option<&str> {
10641064
self.rust_info.sha()
10651065
}
@@ -1079,7 +1079,7 @@ impl Build {
10791079
panic!("failed to find version in {}'s Cargo.toml", package)
10801080
}
10811081

1082-
/// Returns whether unstable features should be enabled for the compiler
1082+
/// Returns `true` if unstable features should be enabled for the compiler
10831083
/// we're building.
10841084
fn unstable_features(&self) -> bool {
10851085
match &self.config.channel[..] {
@@ -1327,7 +1327,7 @@ impl<'a> Compiler {
13271327
self
13281328
}
13291329

1330-
/// Returns whether this is a snapshot compiler for `build`'s configuration
1330+
/// Returns `true` if this is a snapshot compiler for `build`'s configuration
13311331
pub fn is_snapshot(&self, build: &Build) -> bool {
13321332
self.stage == 0 && self.host == build.build
13331333
}

src/bootstrap/test.rs

+9-8
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ const ADB_TEST_DIR: &str = "/data/tmp/work";
3030
/// The two modes of the test runner; tests or benchmarks.
3131
#[derive(Debug, PartialEq, Eq, Hash, Copy, Clone, PartialOrd, Ord)]
3232
pub enum TestKind {
33-
/// Run `cargo test`
33+
/// Run `cargo test`.
3434
Test,
35-
/// Run `cargo bench`
35+
/// Run `cargo bench`.
3636
Bench,
3737
}
3838

@@ -1288,7 +1288,7 @@ impl Step for DocTest {
12881288
run.never()
12891289
}
12901290

1291-
/// Run `rustdoc --test` for all documentation in `src/doc`.
1291+
/// Runs `rustdoc --test` for all documentation in `src/doc`.
12921292
///
12931293
/// This will run all tests in our markdown documentation (e.g., the book)
12941294
/// located in `src/doc`. The `rustdoc` that's run is the one that sits next to
@@ -1383,6 +1383,7 @@ test_book!(
13831383
RustdocBook, "src/doc/rustdoc", "rustdoc", default=true;
13841384
RustcBook, "src/doc/rustc", "rustc", default=true;
13851385
RustByExample, "src/doc/rust-by-example", "rust-by-example", default=false;
1386+
EmbeddedBook, "src/doc/embedded-book", "embedded-book", default=false;
13861387
TheBook, "src/doc/book", "book", default=false;
13871388
UnstableBook, "src/doc/unstable-book", "unstable-book", default=true;
13881389
);
@@ -1407,7 +1408,7 @@ impl Step for ErrorIndex {
14071408
});
14081409
}
14091410

1410-
/// Run the error index generator tool to execute the tests located in the error
1411+
/// Runs the error index generator tool to execute the tests located in the error
14111412
/// index.
14121413
///
14131414
/// The `error_index_generator` tool lives in `src/tools` and is used to
@@ -1613,7 +1614,7 @@ impl Step for Crate {
16131614
}
16141615
}
16151616

1616-
/// Run all unit tests plus documentation tests for a given crate defined
1617+
/// Runs all unit tests plus documentation tests for a given crate defined
16171618
/// by a `Cargo.toml` (single manifest)
16181619
///
16191620
/// This is what runs tests for crates like the standard library, compiler, etc.
@@ -1832,7 +1833,7 @@ fn envify(s: &str) -> String {
18321833
/// the standard library and such to the emulator ahead of time. This step
18331834
/// represents this and is a dependency of all test suites.
18341835
///
1835-
/// Most of the time this is a noop. For some steps such as shipping data to
1836+
/// Most of the time this is a no-op. For some steps such as shipping data to
18361837
/// QEMU we have to build our own tools so we've got conditional dependencies
18371838
/// on those programs as well. Note that the remote test client is built for
18381839
/// the build target (us) and the server is built for the target.
@@ -1903,7 +1904,7 @@ impl Step for Distcheck {
19031904
run.builder.ensure(Distcheck);
19041905
}
19051906

1906-
/// Run "distcheck", a 'make check' from a tarball
1907+
/// Runs "distcheck", a 'make check' from a tarball
19071908
fn run(self, builder: &Builder) {
19081909
builder.info("Distcheck");
19091910
let dir = builder.out.join("tmp").join("distcheck");
@@ -1964,7 +1965,7 @@ impl Step for Bootstrap {
19641965
const DEFAULT: bool = true;
19651966
const ONLY_HOSTS: bool = true;
19661967

1967-
/// Test the build system itself
1968+
/// Tests the build system itself.
19681969
fn run(self, builder: &Builder) {
19691970
let mut cmd = Command::new(&builder.initial_cargo);
19701971
cmd.arg("test")

src/bootstrap/tool.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl Step for ToolBuild {
4040
run.never()
4141
}
4242

43-
/// Build a tool in `src/tools`
43+
/// Builds a tool in `src/tools`
4444
///
4545
/// This will build the specified tool with the specified `host` compiler in
4646
/// `stage` into the normal cargo output directory.
@@ -621,7 +621,7 @@ tool_extended!((self, builder),
621621
);
622622

623623
impl<'a> Builder<'a> {
624-
/// Get a `Command` which is ready to run `tool` in `stage` built for
624+
/// Gets a `Command` which is ready to run `tool` in `stage` built for
625625
/// `host`.
626626
pub fn tool_cmd(&self, tool: Tool) -> Command {
627627
let mut cmd = Command::new(self.tool_exe(tool));

src/bootstrap/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub fn exe(name: &str, target: &str) -> String {
3333
}
3434
}
3535

36-
/// Returns whether the file name given looks like a dynamic library.
36+
/// Returns `true` if the file name given looks like a dynamic library.
3737
pub fn is_dylib(name: &str) -> bool {
3838
name.ends_with(".dylib") || name.ends_with(".so") || name.ends_with(".dll")
3939
}

src/build_helper/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
name = "build_helper"
33
version = "0.1.0"
44
authors = ["The Rust Project Developers"]
5+
edition = "2018"
56

67
[lib]
78
name = "build_helper"

0 commit comments

Comments
 (0)