Skip to content

Commit 6434aaf

Browse files
author
Alexander Regueiro
committed
Various cosmetic improvements
1 parent fe6a54d commit 6434aaf

File tree

1,600 files changed

+5660
-5734
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,600 files changed

+5660
-5734
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn main() {
149149
//
150150
// `compiler_builtins` are unconditionally compiled with panic=abort to
151151
// workaround undefined references to `rust_eh_unwind_resume` generated
152-
// otherwise, see issue https://github.com/rust-lang/rust/issues/43095.
152+
// otherwise, see issue #43095.
153153
if crate_name == "panic_abort" ||
154154
crate_name == "compiler_builtins" && stage != "0" {
155155
cmd.arg("-C").arg("panic=abort");

src/bootstrap/builder.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -794,12 +794,12 @@ impl<'a> Builder<'a> {
794794
}
795795

796796
cargo.arg("-j").arg(self.jobs().to_string());
797-
// Remove make-related flags to ensure Cargo can correctly set things up
797+
// Remove make-related flags to ensure Cargo can correctly set things up.
798798
cargo.env_remove("MAKEFLAGS");
799799
cargo.env_remove("MFLAGS");
800800

801-
// FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005
802-
// Force cargo to output binaries with disambiguating hashes in the name
801+
// FIXME: temporary fix for Cargo issue #3005.
802+
// Force cargo to output binaries with disambiguating hashes in the name.
803803
let metadata = if compiler.stage == 0 {
804804
// Treat stage0 like special channel, whether it's a normal prior-
805805
// release rustc or a local rebuild with the same version, so we
@@ -901,7 +901,7 @@ impl<'a> Builder<'a> {
901901

902902
if mode.is_tool() {
903903
// Tools like cargo and rls don't get debuginfo by default right now, but this can be
904-
// enabled in the config. Adding debuginfo makes them several times larger.
904+
// enabled in the config. Adding debuginfo makes them several times larger.
905905
if self.config.rust_debuginfo_tools {
906906
cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string());
907907
cargo.env(
@@ -1007,7 +1007,7 @@ impl<'a> Builder<'a> {
10071007
// Build scripts use either the `cc` crate or `configure/make` so we pass
10081008
// the options through environment variables that are fetched and understood by both.
10091009
//
1010-
// FIXME: the guard against msvc shouldn't need to be here
1010+
// FIXME: the guard against `msvc` shouldn't need to be here.
10111011
if target.contains("msvc") {
10121012
if let Some(ref cl) = self.config.llvm_clang_cl {
10131013
cargo.env("CC", cl).env("CXX", cl);
@@ -1019,7 +1019,7 @@ impl<'a> Builder<'a> {
10191019
Some(ref s) => s,
10201020
None => return s.display().to_string(),
10211021
};
1022-
// FIXME: the cc-rs crate only recognizes the literal strings
1022+
// FIXME: the cc-rs crate only recognizes the literal strings.
10231023
// `ccache` and `sccache` when doing caching compilations, so we
10241024
// mirror that here. It should probably be fixed upstream to
10251025
// accept a new env var or otherwise work with custom ccache
@@ -1064,12 +1064,12 @@ impl<'a> Builder<'a> {
10641064
cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
10651065
}
10661066

1067-
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs
1067+
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs.
10681068
cargo.env("RUSTDOC_CRATE_VERSION", self.rust_version());
10691069

1070-
// Environment variables *required* throughout the build
1070+
// Environment variables *required* throughout the build.
10711071
//
1072-
// FIXME: should update code to not require this env var
1072+
// FIXME: should update code to not require this env var.
10731073
cargo.env("CFG_COMPILER_HOST_TRIPLE", target);
10741074

10751075
// Set this for all builds to make sure doc builds also get it.
@@ -1460,7 +1460,7 @@ mod __test {
14601460
#[test]
14611461
fn dist_with_target_flag() {
14621462
let mut config = configure(&["B"], &["C"]);
1463-
config.run_host_only = false; // as-if --target=C was passed
1463+
config.run_host_only = false; // as if `--target=C` were passed
14641464
let build = Build::new(config);
14651465
let mut builder = Builder::new(&build);
14661466
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);

src/bootstrap/cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl<T: Hash + Clone + Eq> Default for TyIntern<T> {
176176
impl<T: Hash + Clone + Eq> TyIntern<T> {
177177
fn intern_borrow<B>(&mut self, item: &B) -> Interned<T>
178178
where
179-
B: Eq + Hash + ToOwned<Owned=T> + ?Sized,
179+
B: Eq + Hash + ToOwned<Owned = T> + ?Sized,
180180
T: Borrow<B>,
181181
{
182182
if let Some(i) = self.set.get(&item) {

src/bootstrap/clean.rs

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,12 +152,12 @@ pub fn std_cargo(builder: &Builder,
152152
let features = builder.std_features();
153153

154154
if compiler.stage != 0 && builder.config.sanitizers {
155-
// This variable is used by the sanitizer runtime crates, e.g.
156-
// rustc_lsan, to build the sanitizer runtime from C code
155+
// This variable is used by the sanitizer runtime crates, e.g.,
156+
// `rustc_lsan`, to build the sanitizer runtime from C code
157157
// When this variable is missing, those crates won't compile the C code,
158158
// so we don't set this variable during stage0 where llvm-config is
159159
// missing
160-
// We also only build the runtimes when --enable-sanitizers (or its
160+
// We also only build the runtimes when `--enable-sanitizers` (or its
161161
// config.toml equivalent) is used
162162
let llvm_config = builder.ensure(native::Llvm {
163163
target: builder.config.build,
@@ -933,17 +933,17 @@ impl Step for Assemble {
933933
// produce some other architecture compiler we need to start from
934934
// `build` to get there.
935935
//
936-
// FIXME: Perhaps we should download those libraries?
936+
// FIXME: perhaps we should download those libraries?
937937
// It would make builds faster...
938938
//
939-
// FIXME: It may be faster if we build just a stage 1 compiler and then
939+
// FIXME: it may be faster if we build just a stage 1 compiler and then
940940
// use that to bootstrap this compiler forward.
941941
let build_compiler =
942942
builder.compiler(target_compiler.stage - 1, builder.config.build);
943943

944944
// Build the libraries for this compiler to link to (i.e., the libraries
945945
// it uses at runtime). NOTE: Crates the target compiler compiles don't
946-
// link to these. (FIXME: Is that correct? It seems to be correct most
946+
// link to these. (FIXME: is that correct? It seems to be correct most
947947
// of the time but I think we do link to these for stage2/bin compilers
948948
// when not performing a full bootstrap).
949949
builder.ensure(Rustc {

src/bootstrap/dist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,8 +2062,8 @@ impl Step for Lldb {
20622062
}
20632063
}
20642064

2065-
// The lldb scripts might be installed in lib/python$version
2066-
// or in lib64/python$version. If lib64 exists, use it;
2065+
// The lldb scripts might be installed in `lib/python$version`
2066+
// or in `lib64/python$version`. If lib64 exists, use it;
20672067
// otherwise lib.
20682068
let libdir = builder.llvm_out(target).join("lib64");
20692069
let (libdir, libdir_name) = if libdir.exists() {

src/bootstrap/doc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ impl Step for Std {
486486
.arg("-p").arg(package);
487487
// Create all crate output directories first to make sure rustdoc uses
488488
// relative links.
489-
// FIXME: Cargo should probably do this itself.
489+
// FIXME: cargo should probably do this itself.
490490
t!(fs::create_dir_all(out_dir.join(package)));
491491
cargo.arg("--")
492492
.arg("--markdown-css").arg("rust.css")
@@ -711,7 +711,7 @@ impl Step for Rustc {
711711
for krate in &compiler_crates {
712712
// Create all crate output directories first to make sure rustdoc uses
713713
// relative links.
714-
// FIXME: Cargo should probably do this itself.
714+
// FIXME: cargo should probably do this itself.
715715
t!(fs::create_dir_all(out_dir.join(krate)));
716716
cargo.arg("-p").arg(krate);
717717
}

src/bootstrap/flags.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`"
140140
// We can't use getopt to parse the options until we have completed specifying which
141141
// options are valid, but under the current implementation, some options are conditional on
142142
// the subcommand. Therefore we must manually identify the subcommand first, so that we can
143-
// complete the definition of the options. Then we can use the getopt::Matches object from
143+
// complete the definition of the options. Then we can use the `getopt::Matches` object from
144144
// there on out.
145145
let subcommand = args.iter().find(|&s| {
146146
(s == "build")

src/bootstrap/lib.rs

Lines changed: 3 additions & 3 deletions
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
//!
@@ -606,7 +606,7 @@ impl Build {
606606
self.out.join(&*target).join("crate-docs")
607607
}
608608

609-
/// Returns true if no custom `llvm-config` is set for the specified target.
609+
/// Returns whether no custom `llvm-config` is set for the specified target.
610610
///
611611
/// If no custom `llvm-config` was specified then Rust's llvm will be used.
612612
fn is_rust_llvm(&self, target: Interned<String>) -> bool {
@@ -853,7 +853,7 @@ impl Build {
853853
.map(|p| &**p)
854854
}
855855

856-
/// Returns true if this is a no-std `target`, if defined
856+
/// Returns whether this is a no-std `target`, if defined
857857
fn no_std(&self, target: Interned<String>) -> Option<bool> {
858858
self.config.target_config.get(&target)
859859
.map(|t| t.no_std)

src/bootstrap/native.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl Step for Llvm {
195195
cfg.define("LLDB_CODESIGN_IDENTITY", "");
196196
} else {
197197
// LLDB requires libxml2; but otherwise we want it to be disabled.
198-
// See https://github.com/rust-lang/rust/pull/50104
198+
// See PR #50104.
199199
cfg.define("LLVM_ENABLE_LIBXML2", "OFF");
200200
}
201201

0 commit comments

Comments
 (0)