Skip to content

Commit 244f893

Browse files
committed
Auto merge of #40659 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests - Successful merges: #40241, #40281, #40398, #40521, #40532, #40554, #40566, #40581, #40587 - Failed merges:
2 parents 6738cd4 + d49f869 commit 244f893

File tree

37 files changed

+906
-942
lines changed

37 files changed

+906
-942
lines changed

src/Cargo.lock

+61-29
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/bin/rustc.rs

+7
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ fn main() {
9494
cmd.arg("-Cprefer-dynamic");
9595
}
9696

97+
// Pass the `rustbuild` feature flag to crates which rustbuild is
98+
// building. See the comment in bootstrap/lib.rs where this env var is
99+
// set for more details.
100+
if env::var_os("RUSTBUILD_UNSTABLE").is_some() {
101+
cmd.arg("--cfg").arg("rustbuild");
102+
}
103+
97104
// Help the libc crate compile by assisting it in finding the MUSL
98105
// native libraries.
99106
if let Some(s) = env::var_os("MUSL_ROOT") {

src/bootstrap/lib.rs

+23-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ struct Crate {
180180
///
181181
/// These entries currently correspond to the various output directories of the
182182
/// build system, with each mod generating output in a different directory.
183-
#[derive(Clone, Copy)]
183+
#[derive(Clone, Copy, PartialEq, Eq)]
184184
pub enum Mode {
185185
/// This cargo is going to build the standard library, placing output in the
186186
/// "stageN-std" directory.
@@ -491,14 +491,35 @@ impl Build {
491491
// For other crates, however, we know that we've already got a standard
492492
// library up and running, so we can use the normal compiler to compile
493493
// build scripts in that situation.
494-
if let Mode::Libstd = mode {
494+
if mode == Mode::Libstd {
495495
cargo.env("RUSTC_SNAPSHOT", &self.rustc)
496496
.env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_snapshot_libdir());
497497
} else {
498498
cargo.env("RUSTC_SNAPSHOT", self.compiler_path(compiler))
499499
.env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler));
500500
}
501501

502+
// There are two invariants we try must maintain:
503+
// * stable crates cannot depend on unstable crates (general Rust rule),
504+
// * crates that end up in the sysroot must be unstable (rustbuild rule).
505+
//
506+
// In order to do enforce the latter, we pass the env var
507+
// `RUSTBUILD_UNSTABLE` down the line for any crates which will end up
508+
// in the sysroot. We read this in bootstrap/bin/rustc.rs and if it is
509+
// set, then we pass the `rustbuild` feature to rustc when building the
510+
// the crate.
511+
//
512+
// In turn, crates that can be used here should recognise the `rustbuild`
513+
// feature and opt-in to `rustc_private`.
514+
//
515+
// We can't always pass `rustbuild` because crates which are outside of
516+
// the comipiler, libs, and tests are stable and we don't want to make
517+
// their deps unstable (since this would break the first invariant
518+
// above).
519+
if mode != Mode::Tool {
520+
cargo.env("RUSTBUILD_UNSTABLE", "1");
521+
}
522+
502523
// Ignore incremental modes except for stage0, since we're
503524
// not guaranteeing correctness acros builds if the compiler
504525
// is changing under your feet.`

src/libcollections/fmt.rs

+4
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,10 @@
367367
//! like `{:08}` would yield `00000001` for the integer `1`, while the
368368
//! same format would yield `-0000001` for the integer `-1`. Notice that
369369
//! the negative version has one fewer zero than the positive version.
370+
//! Note that padding zeroes are always placed after the sign (if any)
371+
//! and before the digits. When used together with the `#` flag, a similar
372+
//! rule applies: padding zeroes are inserted after the prefix but before
373+
//! the digits.
370374
//!
371375
//! ## Width
372376
//!

0 commit comments

Comments
 (0)