Skip to content

Commit 126ad2b

Browse files
committed
Auto merge of #68708 - Mark-Simulacrum:stage0-step, r=pietroalbini
Step stage0 to bootstrap from 1.42 This also includes a commit which fixes the rustfmt downloading logic to redownload when the rustfmt channel changes, and bumps rustfmt to a more recent version.
2 parents bae3d0d + dbc9894 commit 126ad2b

File tree

27 files changed

+19
-86
lines changed

27 files changed

+19
-86
lines changed

src/bootstrap/bootstrap.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def support_xz():
397397

398398
if self.rustfmt() and self.rustfmt().startswith(self.bin_root()) and (
399399
not os.path.exists(self.rustfmt())
400-
or self.program_out_of_date(self.rustfmt_stamp())
400+
or self.program_out_of_date(self.rustfmt_stamp(), self.rustfmt_channel)
401401
):
402402
if rustfmt_channel:
403403
tarball_suffix = '.tar.xz' if support_xz() else '.tar.gz'
@@ -407,7 +407,7 @@ def support_xz():
407407
self.fix_executable("{}/bin/rustfmt".format(self.bin_root()))
408408
self.fix_executable("{}/bin/cargo-fmt".format(self.bin_root()))
409409
with output(self.rustfmt_stamp()) as rustfmt_stamp:
410-
rustfmt_stamp.write(self.date)
410+
rustfmt_stamp.write(self.date + self.rustfmt_channel)
411411

412412
def _download_stage0_helper(self, filename, pattern, tarball_suffix, date=None):
413413
if date is None:
@@ -521,12 +521,12 @@ def rustfmt_stamp(self):
521521
"""
522522
return os.path.join(self.bin_root(), '.rustfmt-stamp')
523523

524-
def program_out_of_date(self, stamp_path):
524+
def program_out_of_date(self, stamp_path, extra=""):
525525
"""Check if the given program stamp is out of date"""
526526
if not os.path.exists(stamp_path) or self.clean:
527527
return True
528528
with open(stamp_path, 'r') as stamp:
529-
return self.date != stamp.read()
529+
return (self.date + extra) != stamp.read()
530530

531531
def bin_root(self):
532532
"""Return the binary root directory

src/bootstrap/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use build_helper::output;
1313
use crate::Build;
1414

1515
// The version number
16-
pub const CFG_RELEASE_NUM: &str = "1.42.0";
16+
pub const CFG_RELEASE_NUM: &str = "1.43.0";
1717

1818
pub struct GitInfo {
1919
inner: Option<Info>,

src/bootstrap/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1026,7 +1026,7 @@ impl Build {
10261026
}
10271027

10281028
fn llvm_link_tools_dynamically(&self, target: Interned<String>) -> bool {
1029-
(target.contains("linux-gnu") || target.contains("apple-darwin"))
1029+
target.contains("linux-gnu") || target.contains("apple-darwin")
10301030
}
10311031

10321032
/// Returns the `version` string associated with this compiler for Rust

src/libcore/fmt/mod.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,18 +1080,7 @@ fn run(fmt: &mut Formatter<'_>, arg: &rt::v1::Argument, args: &[ArgumentV1<'_>])
10801080
fmt.precision = getcount(args, &arg.format.precision);
10811081

10821082
// Extract the correct argument
1083-
let value = {
1084-
#[cfg(bootstrap)]
1085-
{
1086-
match arg.position {
1087-
rt::v1::Position::At(i) => args[i],
1088-
}
1089-
}
1090-
#[cfg(not(bootstrap))]
1091-
{
1092-
args[arg.position]
1093-
}
1094-
};
1083+
let value = args[arg.position];
10951084

10961085
// Then actually do some printing
10971086
(value.formatter)(value.value, fmt)

src/libcore/fmt/rt/v1.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
#[derive(Copy, Clone)]
99
pub struct Argument {
10-
#[cfg(bootstrap)]
11-
pub position: Position,
12-
#[cfg(not(bootstrap))]
1310
pub position: usize,
1411
pub format: FormatSpec,
1512
}
@@ -42,9 +39,3 @@ pub enum Count {
4239
Param(usize),
4340
Implied,
4441
}
45-
46-
#[cfg(bootstrap)]
47-
#[derive(Copy, Clone)]
48-
pub enum Position {
49-
At(usize),
50-
}

src/libcore/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@
132132
#![feature(associated_type_bounds)]
133133
#![feature(const_type_id)]
134134
#![feature(const_caller_location)]
135-
#![cfg_attr(bootstrap, feature(slice_patterns))]
136135
#![feature(assoc_int_consts)]
137136

138137
#[prelude_import]

src/libcore/tests/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#![feature(range_is_empty)]
1818
#![feature(raw)]
1919
#![feature(saturating_neg)]
20-
#![cfg_attr(bootstrap, feature(slice_patterns))]
2120
#![feature(sort_internals)]
2221
#![feature(slice_partition_at_index)]
2322
#![feature(specialization)]

src/libpanic_unwind/seh.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,7 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
282282
//
283283
// In any case, we basically need to do something like this until we can
284284
// express more operations in statics (and we may never be able to).
285-
if !cfg!(bootstrap) {
286-
atomic_store(
287-
&mut THROW_INFO.pmfnUnwind as *mut _ as *mut u32,
288-
ptr!(exception_cleanup) as u32,
289-
);
290-
}
285+
atomic_store(&mut THROW_INFO.pmfnUnwind as *mut _ as *mut u32, ptr!(exception_cleanup) as u32);
291286
atomic_store(
292287
&mut THROW_INFO.pCatchableTypeArray as *mut _ as *mut u32,
293288
ptr!(&CATCHABLE_TYPE_ARRAY as *const _) as u32,
@@ -300,12 +295,10 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 {
300295
&mut CATCHABLE_TYPE.pType as *mut _ as *mut u32,
301296
ptr!(&TYPE_DESCRIPTOR as *const _) as u32,
302297
);
303-
if !cfg!(bootstrap) {
304-
atomic_store(
305-
&mut CATCHABLE_TYPE.copyFunction as *mut _ as *mut u32,
306-
ptr!(exception_copy) as u32,
307-
);
308-
}
298+
atomic_store(
299+
&mut CATCHABLE_TYPE.copyFunction as *mut _ as *mut u32,
300+
ptr!(exception_copy) as u32,
301+
);
309302

310303
extern "system" {
311304
#[unwind(allowed)]

src/librustc/benches/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![cfg_attr(bootstrap, feature(slice_patterns))]
21
#![feature(test)]
32

43
extern crate test;

src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#![feature(optin_builtin_traits)]
4343
#![feature(option_expect_none)]
4444
#![feature(range_is_empty)]
45-
#![cfg_attr(bootstrap, feature(slice_patterns))]
4645
#![feature(specialization)]
4746
#![feature(unboxed_closures)]
4847
#![feature(thread_local)]

0 commit comments

Comments
 (0)