Skip to content

Commit 126ad2b

Browse files
committed
Auto merge of rust-lang#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

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

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

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

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

-9
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

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

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

+5-12
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

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

-1
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)]

src/librustc_ast_passes/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
//!
55
//! The crate also contains other misc AST visitors, e.g. `node_count` and `show_span`.
66
7-
#![cfg_attr(bootstrap, feature(slice_patterns))]
8-
97
pub mod ast_validation;
108
pub mod feature_gate;
119
pub mod node_count;

src/librustc_codegen_ssa/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![feature(box_syntax)]
55
#![feature(core_intrinsics)]
66
#![feature(libc)]
7-
#![cfg_attr(bootstrap, feature(slice_patterns))]
87
#![feature(stmt_expr_attributes)]
98
#![feature(try_blocks)]
109
#![feature(in_band_lifetimes)]

src/librustc_macros/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#![allow(rustc::default_hash_types)]
22
#![recursion_limit = "128"]
33

4-
extern crate proc_macro;
5-
64
use synstructure::decl_derive;
75

86
use proc_macro::TokenStream;

src/librustc_metadata/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#![feature(proc_macro_internals)]
1111
#![feature(proc_macro_quote)]
1212
#![feature(rustc_private)]
13-
#![cfg_attr(bootstrap, feature(slice_patterns))]
1413
#![feature(specialization)]
1514
#![feature(stmt_expr_attributes)]
1615
#![recursion_limit = "256"]

src/librustc_mir/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
77
#![feature(nll)]
88
#![feature(in_band_lifetimes)]
99
#![feature(inner_deref)]
10-
#![cfg_attr(bootstrap, feature(slice_patterns))]
1110
#![feature(bool_to_option)]
1211
#![feature(box_patterns)]
1312
#![feature(box_syntax)]

src/librustc_mir_build/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#![feature(box_patterns)]
66
#![feature(box_syntax)]
77
#![feature(crate_visibility_modifier)]
8-
#![cfg_attr(bootstrap, feature(slice_patterns))]
98
#![feature(bool_to_option)]
109
#![recursion_limit = "256"]
1110

src/librustc_parse/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
33
#![feature(bool_to_option)]
44
#![feature(crate_visibility_modifier)]
5-
#![cfg_attr(bootstrap, feature(slice_patterns))]
65

76
use rustc_ast_pretty::pprust;
87
use rustc_data_structures::sync::Lrc;

src/librustc_passes/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
88
#![feature(in_band_lifetimes)]
99
#![feature(nll)]
10-
#![cfg_attr(bootstrap, feature(slice_patterns))]
1110
#![recursion_limit = "256"]
1211

1312
#[macro_use]

src/librustc_resolve/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![feature(crate_visibility_modifier)]
1212
#![feature(label_break_value)]
1313
#![feature(nll)]
14-
#![cfg_attr(bootstrap, feature(slice_patterns))]
1514
#![recursion_limit = "256"]
1615

1716
pub use rustc_hir::def::{Namespace, PerNS};

src/librustc_target/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![feature(box_syntax)]
1212
#![feature(bool_to_option)]
1313
#![feature(nll)]
14-
#![cfg_attr(bootstrap, feature(slice_patterns))]
1514

1615
#[macro_use]
1716
extern crate log;

src/librustc_ty/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#![feature(bool_to_option)]
99
#![feature(in_band_lifetimes)]
1010
#![feature(nll)]
11-
#![cfg_attr(bootstrap, feature(slice_patterns))]
1211
#![recursion_limit = "256"]
1312

1413
#[macro_use]

src/librustc_typeck/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ This API is completely unstable and subject to change.
6464
#![feature(exhaustive_patterns)]
6565
#![feature(in_band_lifetimes)]
6666
#![feature(nll)]
67-
#![cfg_attr(bootstrap, feature(slice_patterns))]
6867
#![feature(try_blocks)]
6968
#![feature(never_type)]
7069
#![recursion_limit = "256"]

src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@
294294
#![feature(shrink_to)]
295295
#![feature(slice_concat_ext)]
296296
#![feature(slice_internals)]
297-
#![cfg_attr(bootstrap, feature(slice_patterns))]
298297
#![feature(specialization)]
299298
#![feature(staged_api)]
300299
#![feature(std_internals)]

src/libstd/macros.rs

-21
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@
44
//! library. Each macro is available for use when linking against the standard
55
//! library.
66
7-
#[cfg(bootstrap)]
8-
#[doc(include = "../libcore/macros/panic.md")]
9-
#[macro_export]
10-
#[stable(feature = "rust1", since = "1.0.0")]
11-
#[allow_internal_unstable(libstd_sys_internals)]
12-
macro_rules! panic {
13-
() => ({
14-
$crate::panic!("explicit panic")
15-
});
16-
($msg:expr) => ({
17-
$crate::rt::begin_panic($msg, &($crate::file!(), $crate::line!(), $crate::column!()))
18-
});
19-
($msg:expr,) => ({
20-
$crate::panic!($msg)
21-
});
22-
($fmt:expr, $($arg:tt)+) => ({
23-
$crate::rt::begin_panic_fmt(&$crate::format_args!($fmt, $($arg)+))
24-
});
25-
}
26-
27-
#[cfg(not(bootstrap))]
287
#[doc(include = "../libcore/macros/panic.md")]
298
#[macro_export]
309
#[stable(feature = "rust1", since = "1.0.0")]

src/libstd/panicking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ pub fn begin_panic_handler(info: &PanicInfo<'_>) -> ! {
389389
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
390390
#[cold]
391391
#[track_caller]
392-
pub fn begin_panic<M: Any + Send>(msg: M, #[cfg(bootstrap)] _: &(&str, u32, u32)) -> ! {
392+
pub fn begin_panic<M: Any + Send>(msg: M) -> ! {
393393
if cfg!(feature = "panic_immediate_abort") {
394394
unsafe { intrinsics::abort() }
395395
}

src/libsyntax/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(label_break_value)]
1414
#![feature(nll)]
1515
#![feature(try_trait)]
16-
#![cfg_attr(bootstrap, feature(slice_patterns))]
1716
#![feature(unicode_internals)]
1817
#![recursion_limit = "256"]
1918

src/stage0.txt

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
1313
# `0.x.0` for Cargo where they were released on `date`.
1414

15-
date: 2019-12-18
15+
date: 2020-01-30
1616
rustc: beta
1717
cargo: beta
1818

19-
# We use a nightly rustfmt to format the source because it solves some bootstrapping
20-
# issues with use of new syntax in this repo. If you're looking at the beta/stable branch, this key should be omitted,
21-
# as we don't want to depend on rustfmt from nightly there.
22-
rustfmt: nightly-2019-12-18
19+
# We use a nightly rustfmt to format the source because it solves some
20+
# bootstrapping issues with use of new syntax in this repo. If you're looking at
21+
# the beta/stable branch, this key should be omitted, as we don't want to depend
22+
# on rustfmt from nightly there.
23+
rustfmt: nightly-2020-01-31
2324

2425
# When making a stable release the process currently looks like:
2526
#

0 commit comments

Comments
 (0)