Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d963910

Browse files
author
Alexander Regueiro
committedFeb 16, 2019
rustc: comments
1 parent eac0908 commit d963910

File tree

364 files changed

+4321
-4193
lines changed

Some content is hidden

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

364 files changed

+4321
-4193
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: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash {
8080
// It is reasonable to not have an implementation of make_run for rules
8181
// who do not want to get called from the root context. This means that
8282
// they are likely dependencies (e.g., sysroot creation) or similar, and
83-
// as such calling them from ./x.py isn't logical.
83+
// as such calling them from `./x.py` isn't logical.
8484
unimplemented!()
8585
}
8686
}
@@ -236,11 +236,11 @@ impl StepDescription {
236236
#[derive(Clone)]
237237
pub struct ShouldRun<'a> {
238238
pub builder: &'a Builder<'a>,
239-
// use a BTreeSet to maintain sort order
239+
// Use a `BTreeSet` to maintain sort order.
240240
paths: BTreeSet<PathSet>,
241241

242242
// If this is a default rule, this is an additional constraint placed on
243-
// its run. Generally something like compiler docs being enabled.
243+
// its run (generally something like compiler docs being enabled).
244244
is_really_default: bool,
245245
}
246246

@@ -249,7 +249,8 @@ impl<'a> ShouldRun<'a> {
249249
ShouldRun {
250250
builder,
251251
paths: BTreeSet::new(),
252-
is_really_default: true, // by default no additional conditions
252+
// By default no additional conditions.
253+
is_really_default: true,
253254
}
254255
}
255256

@@ -277,12 +278,12 @@ impl<'a> ShouldRun<'a> {
277278
self
278279
}
279280

280-
// single, non-aliased path
281+
// Single, non-aliased path.
281282
pub fn path(self, path: &str) -> Self {
282283
self.paths(&[path])
283284
}
284285

285-
// multiple aliases for the same job
286+
// Multiple aliases for the same job.
286287
pub fn paths(mut self, paths: &[&str]) -> Self {
287288
self.paths
288289
.insert(PathSet::Set(paths.iter().map(PathBuf::from).collect()));
@@ -301,7 +302,7 @@ impl<'a> ShouldRun<'a> {
301302
self
302303
}
303304

304-
// allows being more explicit about why should_run in Step returns the value passed to it
305+
// Allows being more explicit about why `Step::should_run` returns the value passed to it.
305306
pub fn never(mut self) -> ShouldRun<'a> {
306307
self.paths.insert(PathSet::empty());
307308
self
@@ -677,7 +678,7 @@ impl<'a> Builder<'a> {
677678
let compiler = self.compiler(self.top_stage, host);
678679
cmd.env("RUSTC_STAGE", compiler.stage.to_string())
679680
.env("RUSTC_SYSROOT", self.sysroot(compiler))
680-
// Note that this is *not* the sysroot_libdir because rustdoc must be linked
681+
// Note that this is *not* the `sysroot_libdir` because rustdoc must be linked
681682
// equivalently to rustc.
682683
.env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler))
683684
.env("CFG_RELEASE_CHANNEL", &self.config.channel)
@@ -813,12 +814,12 @@ impl<'a> Builder<'a> {
813814
}
814815

815816
cargo.arg("-j").arg(self.jobs().to_string());
816-
// Remove make-related flags to ensure Cargo can correctly set things up
817+
// Remove make-related flags to ensure Cargo can correctly set things up.
817818
cargo.env_remove("MAKEFLAGS");
818819
cargo.env_remove("MFLAGS");
819820

820-
// FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005
821-
// Force cargo to output binaries with disambiguating hashes in the name
821+
// FIXME: temporary fix for rust-lang/cargo#3005.
822+
// Force cargo to output binaries with disambiguating hashes in the name.
822823
let metadata = if compiler.stage == 0 {
823824
// Treat stage0 like special channel, whether it's a normal prior-
824825
// release rustc or a local rebuild with the same version, so we
@@ -863,7 +864,7 @@ impl<'a> Builder<'a> {
863864
// "raw" compiler in that it's the exact snapshot we download. Normally
864865
// the stage0 build means it uses libraries build by the stage0
865866
// compiler, but for tools we just use the precompiled libraries that
866-
// we've downloaded
867+
// we've downloaded.
867868
let use_snapshot = mode == Mode::ToolBootstrap;
868869
assert!(!use_snapshot || stage == 0 || self.local_rebuild);
869870

@@ -920,7 +921,7 @@ impl<'a> Builder<'a> {
920921

921922
if mode.is_tool() {
922923
// Tools like cargo and rls don't get debuginfo by default right now, but this can be
923-
// enabled in the config. Adding debuginfo makes them several times larger.
924+
// enabled in the config. Adding debuginfo makes them several times larger.
924925
if self.config.rust_debuginfo_tools {
925926
cargo.env("RUSTC_DEBUGINFO", self.config.rust_debuginfo.to_string());
926927
cargo.env(
@@ -1028,7 +1029,7 @@ impl<'a> Builder<'a> {
10281029
// Build scripts use either the `cc` crate or `configure/make` so we pass
10291030
// the options through environment variables that are fetched and understood by both.
10301031
//
1031-
// FIXME: the guard against msvc shouldn't need to be here
1032+
// FIXME: the guard against MSVC shouldn't need to be here.
10321033
if target.contains("msvc") {
10331034
if let Some(ref cl) = self.config.llvm_clang_cl {
10341035
cargo.env("CC", cl).env("CXX", cl);
@@ -1040,7 +1041,7 @@ impl<'a> Builder<'a> {
10401041
Some(ref s) => s,
10411042
None => return s.display().to_string(),
10421043
};
1043-
// FIXME: the cc-rs crate only recognizes the literal strings
1044+
// FIXME: the cc-rs crate only recognizes the literal strings.
10441045
// `ccache` and `sccache` when doing caching compilations, so we
10451046
// mirror that here. It should probably be fixed upstream to
10461047
// accept a new env var or otherwise work with custom ccache
@@ -1080,12 +1081,12 @@ impl<'a> Builder<'a> {
10801081
cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
10811082
}
10821083

1083-
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs
1084+
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs.
10841085
cargo.env("RUSTDOC_CRATE_VERSION", self.rust_version());
10851086

1086-
// Environment variables *required* throughout the build
1087+
// Environment variables *required* throughout the build.
10871088
//
1088-
// FIXME: should update code to not require this env var
1089+
// FIXME: should update code to not require this env var.
10891090
cargo.env("CFG_COMPILER_HOST_TRIPLE", target);
10901091

10911092
// Set this for all builds to make sure doc builds also get it.
@@ -1476,7 +1477,7 @@ mod __test {
14761477
#[test]
14771478
fn dist_with_target_flag() {
14781479
let mut config = configure(&["B"], &["C"]);
1479-
config.run_host_only = false; // as-if --target=C was passed
1480+
config.run_host_only = false; // as if `--target=C` were passed
14801481
let build = Build::new(config);
14811482
let mut builder = Builder::new(&build);
14821483
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);

0 commit comments

Comments
 (0)
Please sign in to comment.