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

+1-1
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

+10-10
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

+1-1
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

+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

+6-6
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

+2-2
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

+2-2
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

+1-1
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

+3-3
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

+1-1
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

src/bootstrap/sanity.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ pub fn check(build: &mut Build) {
6262
// On Windows, quotes are invalid characters for filename paths, and if
6363
// one is present as part of the PATH then that can lead to the system
6464
// being unable to identify the files properly. See
65-
// https://github.com/rust-lang/rust/issues/34959 for more details.
65+
// issue #34959 for more details.
6666
if cfg!(windows) && path.to_string_lossy().contains('\"') {
6767
panic!("PATH contains invalid character '\"'");
6868
}
6969

7070
let mut cmd_finder = Finder::new();
71-
// If we've got a git directory we're gonna need git to update
71+
// If we've got a Git directory we're gonna need git to update
7272
// submodules and learn about various other aspects.
7373
if build.rust_info.is_git() {
7474
cmd_finder.must_have("git");
@@ -122,7 +122,7 @@ pub fn check(build: &mut Build) {
122122
// We're gonna build some custom C code here and there, host triples
123123
// also build some C++ shims for LLVM so we need a C++ compiler.
124124
for target in &build.targets {
125-
// On emscripten we don't actually need the C compiler to just
125+
// On Emscripten we don't actually need the C compiler to just
126126
// build the target artifacts, only for testing. For the sake
127127
// of easier bot configuration, just skip detection.
128128
if target.contains("emscripten") {

src/bootstrap/test.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,8 @@ impl Step for Clippy {
517517
}
518518

519519
fn path_for_cargo(builder: &Builder, compiler: Compiler) -> OsString {
520-
// Configure PATH to find the right rustc. NB. we have to use PATH
521-
// and not RUSTC because the Cargo test suite has tests that will
520+
// Configure `PATH` to find the right rustc. N.B., we have to use PATH
521+
// and not `RUSTC` because the Cargo test suite has tests that will
522522
// fail if rustc is not spelled `rustc`.
523523
let path = builder.sysroot(compiler).join("bin");
524524
let old_path = env::var_os("PATH").unwrap_or_default();
@@ -971,7 +971,7 @@ impl Step for Compiletest {
971971
}
972972

973973
if suite.ends_with("fulldeps") ||
974-
// FIXME: Does pretty need librustc compiled? Note that there are
974+
// FIXME: does pretty need librustc compiled? Note that there are
975975
// fulldeps test suites with mode = pretty as well.
976976
mode == "pretty"
977977
{
@@ -1966,7 +1966,7 @@ impl Step for Bootstrap {
19661966
const DEFAULT: bool = true;
19671967
const ONLY_HOSTS: bool = true;
19681968

1969-
/// Test the build system itself
1969+
/// Test the build system itself.
19701970
fn run(self, builder: &Builder) {
19711971
let mut cmd = Command::new(&builder.initial_cargo);
19721972
cmd.arg("test")
@@ -1977,8 +1977,8 @@ impl Step for Bootstrap {
19771977
.env("RUSTC", &builder.initial_rustc);
19781978
if let Some(flags) = option_env!("RUSTFLAGS") {
19791979
// Use the same rustc flags for testing as for "normal" compilation,
1980-
// so that Cargo doesn’t recompile the entire dependency graph every time:
1981-
// https://github.com/rust-lang/rust/issues/49215
1980+
// so that Cargo doesn’t recompile the entire dependency graph every time
1981+
// (issue #49215).
19821982
cmd.env("RUSTFLAGS", flags);
19831983
}
19841984
if !builder.fail_fast {

src/liballoc/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use core::usize;
1111
pub use core::alloc::*;
1212

1313
extern "Rust" {
14-
// These are the magic symbols to call the global allocator. rustc generates
14+
// These are the magic symbols to call the global allocator. rustc generates
1515
// them from the `#[global_allocator]` attribute if there is one, or uses the
1616
// default implementations in libstd (`__rdl_alloc` etc in `src/libstd/alloc.rs`)
1717
// otherwise.

src/liballoc/borrow.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@ impl<T> ToOwned for T
137137
/// ```
138138
/// use std::borrow::{Cow, ToOwned};
139139
///
140-
/// struct Items<'a, X: 'a> where [X]: ToOwned<Owned=Vec<X>> {
140+
/// struct Items<'a, X: 'a> where [X]: ToOwned<Owned = Vec<X>> {
141141
/// values: Cow<'a, [X]>,
142142
/// }
143143
///
144-
/// impl<'a, X: Clone + 'a> Items<'a, X> where [X]: ToOwned<Owned=Vec<X>> {
144+
/// impl<'a, X: Clone + 'a> Items<'a, X> where [X]: ToOwned<Owned = Vec<X>> {
145145
/// fn new(v: Cow<'a, [X]>) -> Self {
146146
/// Items { values: v }
147147
/// }
@@ -262,7 +262,7 @@ impl<'a, B: ?Sized> Cow<'a, B>
262262
/// );
263263
/// ```
264264
///
265-
/// Calling `into_owned` on a `Cow::Owned` is a no-op:
265+
/// Calling `into_owned` on a `Cow::Owned` is a noop:
266266
///
267267
/// ```
268268
/// use std::borrow::Cow;

src/liballoc/boxed.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ impl<T: ?Sized> Box<T> {
262262
#[stable(feature = "rust1", since = "1.0.0")]
263263
unsafe impl<#[may_dangle] T: ?Sized> Drop for Box<T> {
264264
fn drop(&mut self) {
265-
// FIXME: Do nothing, drop is currently performed by compiler.
265+
// FIXME: do nothing; drop is currently performed by compiler.
266266
}
267267
}
268268

@@ -457,7 +457,7 @@ impl<T> From<Box<T>> for Pin<Box<T>> {
457457
/// This conversion does not allocate on the heap and happens in place.
458458
fn from(boxed: Box<T>) -> Self {
459459
// It's not possible to move or replace the insides of a `Pin<Box<T>>`
460-
// when `T: !Unpin`, so it's safe to pin it directly without any
460+
// when `T: !Unpin`, so it's safe to pin it directly without any
461461
// additional requirements.
462462
unsafe { Pin::new_unchecked(boxed) }
463463
}

src/liballoc/collections/btree/map.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
604604
}
605605
}
606606

607-
/// Returns `true` if the map contains a value for the specified key.
607+
/// Returns whether the map contains a value for the specified key.
608608
///
609609
/// The key may be any borrowed form of the map's key type, but the ordering
610610
/// on the borrowed form *must* match the ordering on the key type.
@@ -892,7 +892,7 @@ impl<K: Ord, V> BTreeMap<K, V> {
892892
/// ```
893893
#[stable(feature = "rust1", since = "1.0.0")]
894894
pub fn entry(&mut self, key: K) -> Entry<K, V> {
895-
// FIXME(@porglezomp) Avoid allocating if we don't insert
895+
// FIXME(porglezomp): avoid allocating if we don't insert.
896896
self.ensure_root_is_owned();
897897
match search::search_tree(self.root.as_mut(), &key) {
898898
Found(handle) => {
@@ -1841,12 +1841,12 @@ fn range_search<BorrowType, K, V, Q: ?Sized, R: RangeBounds<Q>>(
18411841
where Q: Ord, K: Borrow<Q>
18421842
{
18431843
match (range.start_bound(), range.end_bound()) {
1844-
(Excluded(s), Excluded(e)) if s==e =>
1844+
(Excluded(s), Excluded(e)) if s == e =>
18451845
panic!("range start and end are equal and excluded in BTreeMap"),
18461846
(Included(s), Included(e)) |
18471847
(Included(s), Excluded(e)) |
18481848
(Excluded(s), Included(e)) |
1849-
(Excluded(s), Excluded(e)) if s>e =>
1849+
(Excluded(s), Excluded(e)) if s > e =>
18501850
panic!("range start is greater than range end in BTreeMap"),
18511851
_ => {},
18521852
};
@@ -2072,7 +2072,7 @@ impl<K, V> BTreeMap<K, V> {
20722072
self.length
20732073
}
20742074

2075-
/// Returns `true` if the map contains no elements.
2075+
/// Returns whether the map contains no elements.
20762076
///
20772077
/// # Examples
20782078
///

0 commit comments

Comments
 (0)