Skip to content

Commit 082cf2f

Browse files
committed
Auto merge of #63534 - Mark-Simulacrum:stage0-bump, r=Centril
Bump to 1.39 r? @Centril
2 parents c43d03a + f7ff36d commit 082cf2f

File tree

39 files changed

+78
-212
lines changed

39 files changed

+78
-212
lines changed

src/bootstrap/bin/rustc.rs

+6-17
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@ fn main() {
4545
}
4646
}
4747

48-
// Drop `--error-format json` because despite our desire for json messages
49-
// from Cargo we don't want any from rustc itself.
50-
if let Some(n) = args.iter().position(|n| n == "--error-format") {
51-
args.remove(n);
52-
args.remove(n);
53-
}
54-
55-
if let Some(s) = env::var_os("RUSTC_ERROR_FORMAT") {
56-
args.push("--error-format".into());
57-
args.push(s);
58-
}
59-
6048
// Detect whether or not we're a build script depending on whether --target
6149
// is passed (a bit janky...)
6250
let target = args.windows(2)
@@ -110,7 +98,11 @@ fn main() {
11098

11199
// Non-zero stages must all be treated uniformly to avoid problems when attempting to uplift
112100
// compiler libraries and such from stage 1 to 2.
113-
if stage == "0" {
101+
//
102+
// FIXME: the fact that core here is excluded is due to core_arch from our stdarch submodule
103+
// being broken on the beta compiler with bootstrap passed, so this is a temporary workaround
104+
// (we've just snapped, so there are no cfg(bootstrap) related annotations in core).
105+
if stage == "0" && crate_name != Some("core") {
114106
cmd.arg("--cfg").arg("bootstrap");
115107
}
116108

@@ -132,10 +124,7 @@ fn main() {
132124
cmd.arg("-Dwarnings");
133125
cmd.arg("-Drust_2018_idioms");
134126
cmd.arg("-Dunused_lifetimes");
135-
// cfg(not(bootstrap)): Remove this during the next stage 0 compiler update.
136-
// `-Drustc::internal` is a new feature and `rustc_version` mis-reports the `stage`.
137-
let cfg_not_bootstrap = stage != "0" && crate_name != Some("rustc_version");
138-
if cfg_not_bootstrap && use_internal_lints(crate_name) {
127+
if use_internal_lints(crate_name) {
139128
cmd.arg("-Zunstable-options");
140129
cmd.arg("-Drustc::internal");
141130
}

src/bootstrap/builder.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl StepDescription {
145145
only_hosts: S::ONLY_HOSTS,
146146
should_run: S::should_run,
147147
make_run: S::make_run,
148-
name: unsafe { ::std::intrinsics::type_name::<S>() },
148+
name: std::any::type_name::<S>(),
149149
}
150150
}
151151

@@ -980,9 +980,6 @@ impl<'a> Builder<'a> {
980980
if let Some(target_linker) = self.linker(target) {
981981
cargo.env("RUSTC_TARGET_LINKER", target_linker);
982982
}
983-
if let Some(ref error_format) = self.config.rustc_error_format {
984-
cargo.env("RUSTC_ERROR_FORMAT", error_format);
985-
}
986983
if !(["build", "check", "clippy", "fix", "rustc"].contains(&cmd)) && want_rustdoc {
987984
cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler));
988985
}

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.38.0";
16+
pub const CFG_RELEASE_NUM: &str = "1.39.0";
1717

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

src/bootstrap/compile.rs

+6-14
Original file line numberDiff line numberDiff line change
@@ -1116,10 +1116,6 @@ pub fn run_cargo(builder: &Builder<'_>,
11161116
},
11171117
..
11181118
} => (filenames, crate_types),
1119-
CargoMessage::CompilerMessage { message } => {
1120-
eprintln!("{}", message.rendered);
1121-
return;
1122-
}
11231119
_ => return,
11241120
};
11251121
for filename in filenames {
@@ -1256,8 +1252,12 @@ pub fn stream_cargo(
12561252
}
12571253
// Instruct Cargo to give us json messages on stdout, critically leaving
12581254
// stderr as piped so we can get those pretty colors.
1259-
cargo.arg("--message-format").arg("json")
1260-
.stdout(Stdio::piped());
1255+
let mut message_format = String::from("json-render-diagnostics");
1256+
if let Some(s) = &builder.config.rustc_error_format {
1257+
message_format.push_str(",json-diagnostic-");
1258+
message_format.push_str(s);
1259+
}
1260+
cargo.arg("--message-format").arg(message_format).stdout(Stdio::piped());
12611261

12621262
for arg in tail_args {
12631263
cargo.arg(arg);
@@ -1310,12 +1310,4 @@ pub enum CargoMessage<'a> {
13101310
BuildScriptExecuted {
13111311
package_id: Cow<'a, str>,
13121312
},
1313-
CompilerMessage {
1314-
message: ClippyMessage<'a>
1315-
}
1316-
}
1317-
1318-
#[derive(Deserialize)]
1319-
pub struct ClippyMessage<'a> {
1320-
rendered: Cow<'a, str>,
13211313
}

src/liballoc/collections/btree/node.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ impl<K, V> LeafNode<K, V> {
106106
LeafNode {
107107
// As a general policy, we leave fields uninitialized if they can be, as this should
108108
// be both slightly faster and easier to track in Valgrind.
109-
keys: uninit_array![_; CAPACITY],
110-
vals: uninit_array![_; CAPACITY],
109+
keys: [MaybeUninit::UNINIT; CAPACITY],
110+
vals: [MaybeUninit::UNINIT; CAPACITY],
111111
parent: ptr::null(),
112112
parent_idx: MaybeUninit::uninit(),
113113
len: 0
@@ -159,7 +159,7 @@ impl<K, V> InternalNode<K, V> {
159159
unsafe fn new() -> Self {
160160
InternalNode {
161161
data: LeafNode::new(),
162-
edges: uninit_array![_; 2*B],
162+
edges: [MaybeUninit::UNINIT; 2*B]
163163
}
164164
}
165165
}

src/liballoc/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#![warn(missing_debug_implementations)]
7070
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
7171
#![allow(explicit_outlives_requirements)]
72-
#![cfg_attr(not(bootstrap), allow(incomplete_features))]
72+
#![allow(incomplete_features)]
7373

7474
#![cfg_attr(not(test), feature(generator_trait))]
7575
#![cfg_attr(test, feature(test))]
@@ -84,7 +84,7 @@
8484
#![feature(coerce_unsized)]
8585
#![feature(const_generic_impls_guard)]
8686
#![feature(const_generics)]
87-
#![cfg_attr(not(bootstrap), feature(const_in_array_repeat_expressions))]
87+
#![feature(const_in_array_repeat_expressions)]
8888
#![feature(dispatch_from_dyn)]
8989
#![feature(core_intrinsics)]
9090
#![feature(dropck_eyepatch)]
@@ -118,7 +118,7 @@
118118
#![feature(rustc_const_unstable)]
119119
#![feature(const_vec_new)]
120120
#![feature(slice_partition_dedup)]
121-
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_array)]
121+
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
122122
#![feature(alloc_layout_extra)]
123123
#![feature(try_trait)]
124124
#![feature(mem_take)]

src/libcore/any.rs

-5
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,5 @@ impl TypeId {
470470
#[stable(feature = "type_name", since = "1.38.0")]
471471
#[rustc_const_unstable(feature = "const_type_name")]
472472
pub const fn type_name<T: ?Sized>() -> &'static str {
473-
#[cfg(bootstrap)]
474-
unsafe {
475-
intrinsics::type_name::<T>()
476-
}
477-
#[cfg(not(bootstrap))]
478473
intrinsics::type_name::<T>()
479474
}

src/libcore/char/methods.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,7 @@ impl char {
553553
/// `XID_Start` is a Unicode Derived Property specified in
554554
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
555555
/// mostly similar to `ID_Start` but modified for closure under `NFKx`.
556-
#[cfg_attr(bootstrap,
557-
unstable(feature = "rustc_private",
558-
reason = "mainly needed for compiler internals",
559-
issue = "27812"))]
560-
#[cfg_attr(not(bootstrap),
561-
unstable(feature = "unicode_internals", issue = "0"))]
556+
#[unstable(feature = "unicode_internals", issue = "0")]
562557
pub fn is_xid_start(self) -> bool {
563558
derived_property::XID_Start(self)
564559
}
@@ -569,12 +564,7 @@ impl char {
569564
/// `XID_Continue` is a Unicode Derived Property specified in
570565
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
571566
/// mostly similar to `ID_Continue` but modified for closure under NFKx.
572-
#[cfg_attr(bootstrap,
573-
unstable(feature = "rustc_private",
574-
reason = "mainly needed for compiler internals",
575-
issue = "27812"))]
576-
#[cfg_attr(not(bootstrap),
577-
unstable(feature = "unicode_internals", issue = "0"))]
567+
#[unstable(feature = "unicode_internals", issue = "0")]
578568
#[inline]
579569
pub fn is_xid_continue(self) -> bool {
580570
derived_property::XID_Continue(self)

src/libcore/clone.rs

-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ pub trait Clone : Sized {
134134
}
135135

136136
/// Derive macro generating an impl of the trait `Clone`.
137-
#[cfg(not(bootstrap))]
138137
#[rustc_builtin_macro]
139138
#[rustc_macro_transparency = "semitransparent"]
140139
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

src/libcore/cmp.rs

-4
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
201201
}
202202

203203
/// Derive macro generating an impl of the trait `PartialEq`.
204-
#[cfg(not(bootstrap))]
205204
#[rustc_builtin_macro]
206205
#[rustc_macro_transparency = "semitransparent"]
207206
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
@@ -265,7 +264,6 @@ pub trait Eq: PartialEq<Self> {
265264
}
266265

267266
/// Derive macro generating an impl of the trait `Eq`.
268-
#[cfg(not(bootstrap))]
269267
#[rustc_builtin_macro]
270268
#[rustc_macro_transparency = "semitransparent"]
271269
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
@@ -617,7 +615,6 @@ pub trait Ord: Eq + PartialOrd<Self> {
617615
}
618616

619617
/// Derive macro generating an impl of the trait `Ord`.
620-
#[cfg(not(bootstrap))]
621618
#[rustc_builtin_macro]
622619
#[rustc_macro_transparency = "semitransparent"]
623620
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
@@ -867,7 +864,6 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
867864
}
868865

869866
/// Derive macro generating an impl of the trait `PartialOrd`.
870-
#[cfg(not(bootstrap))]
871867
#[rustc_builtin_macro]
872868
#[rustc_macro_transparency = "semitransparent"]
873869
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

src/libcore/default.rs

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ pub trait Default: Sized {
116116
}
117117

118118
/// Derive macro generating an impl of the trait `Default`.
119-
#[cfg(not(bootstrap))]
120119
#[rustc_builtin_macro]
121120
#[rustc_macro_transparency = "semitransparent"]
122121
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

src/libcore/fmt/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,6 @@ pub trait Debug {
546546
}
547547

548548
// Separate module to reexport the macro `Debug` from prelude without the trait `Debug`.
549-
#[cfg(not(bootstrap))]
550549
pub(crate) mod macros {
551550
/// Derive macro generating an impl of the trait `Debug`.
552551
#[rustc_builtin_macro]
@@ -555,7 +554,6 @@ pub(crate) mod macros {
555554
#[allow_internal_unstable(core_intrinsics)]
556555
pub macro Debug($item:item) { /* compiler built-in */ }
557556
}
558-
#[cfg(not(bootstrap))]
559557
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
560558
#[doc(inline)]
561559
pub use macros::Debug;

src/libcore/hash/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ pub trait Hash {
199199
}
200200

201201
// Separate module to reexport the macro `Hash` from prelude without the trait `Hash`.
202-
#[cfg(not(bootstrap))]
203202
pub(crate) mod macros {
204203
/// Derive macro generating an impl of the trait `Hash`.
205204
#[rustc_builtin_macro]
@@ -208,7 +207,6 @@ pub(crate) mod macros {
208207
#[allow_internal_unstable(core_intrinsics)]
209208
pub macro Hash($item:item) { /* compiler built-in */ }
210209
}
211-
#[cfg(not(bootstrap))]
212210
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
213211
#[doc(inline)]
214212
pub use macros::Hash;

src/libcore/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
#![warn(missing_debug_implementations)]
6464
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
6565
#![allow(explicit_outlives_requirements)]
66-
#![cfg_attr(not(bootstrap), allow(incomplete_features))]
66+
#![allow(incomplete_features)]
6767

6868
#![feature(allow_internal_unstable)]
6969
#![feature(arbitrary_self_types)]
@@ -129,7 +129,7 @@
129129
#![feature(structural_match)]
130130
#![feature(abi_unadjusted)]
131131
#![feature(adx_target_feature)]
132-
#![feature(maybe_uninit_slice, maybe_uninit_array)]
132+
#![feature(maybe_uninit_slice)]
133133
#![feature(external_doc)]
134134
#![feature(mem_take)]
135135
#![feature(associated_type_bounds)]

src/libcore/macros.rs

-35
Original file line numberDiff line numberDiff line change
@@ -635,46 +635,11 @@ macro_rules! todo {
635635
($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)+)));
636636
}
637637

638-
/// Creates an array of [`MaybeUninit`].
639-
///
640-
/// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
641-
/// It exists solely because bootstrap does not yet support const array-init expressions.
642-
///
643-
/// [`MaybeUninit`]: mem/union.MaybeUninit.html
644-
// FIXME: Remove both versions of this macro once bootstrap is 1.38.
645-
#[macro_export]
646-
#[unstable(feature = "maybe_uninit_array", issue = "53491")]
647-
#[cfg(bootstrap)]
648-
macro_rules! uninit_array {
649-
// This `assume_init` is safe because an array of `MaybeUninit` does not
650-
// require initialization.
651-
($t:ty; $size:expr) => (unsafe {
652-
MaybeUninit::<[MaybeUninit<$t>; $size]>::uninit().assume_init()
653-
});
654-
}
655-
656-
/// Creates an array of [`MaybeUninit`].
657-
///
658-
/// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
659-
/// It exists solely because bootstrap does not yet support const array-init expressions.
660-
///
661-
/// [`MaybeUninit`]: mem/union.MaybeUninit.html
662-
// FIXME: Just inline this version of the macro once bootstrap is 1.38.
663-
#[macro_export]
664-
#[unstable(feature = "maybe_uninit_array", issue = "53491")]
665-
#[cfg(not(bootstrap))]
666-
macro_rules! uninit_array {
667-
($t:ty; $size:expr) => (
668-
[MaybeUninit::<$t>::UNINIT; $size]
669-
);
670-
}
671-
672638
/// Definitions of built-in macros.
673639
///
674640
/// Most of the macro properties (stability, visibility, etc.) are taken from the source code here,
675641
/// with exception of expansion functions transforming macro inputs into outputs,
676642
/// those functions are provided by the compiler.
677-
#[cfg(not(bootstrap))]
678643
pub(crate) mod builtin {
679644

680645
/// Causes compilation to fail with the given error message when encountered.

src/libcore/marker.rs

-1
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,6 @@ pub trait Copy : Clone {
289289
}
290290

291291
/// Derive macro generating an impl of the trait `Copy`.
292-
#[cfg(not(bootstrap))]
293292
#[rustc_builtin_macro]
294293
#[rustc_macro_transparency = "semitransparent"]
295294
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

src/libcore/mem/maybe_uninit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ use crate::mem::ManuallyDrop;
213213
#[allow(missing_debug_implementations)]
214214
#[stable(feature = "maybe_uninit", since = "1.36.0")]
215215
// Lang item so we can wrap other types in it. This is useful for generators.
216-
#[cfg_attr(not(bootstrap), lang = "maybe_uninit")]
216+
#[lang = "maybe_uninit"]
217217
#[derive(Copy)]
218218
#[repr(transparent)]
219219
pub union MaybeUninit<T> {

src/libcore/mem/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ pub const fn needs_drop<T>() -> bool {
453453
/// ```
454454
#[inline]
455455
#[stable(feature = "rust1", since = "1.0.0")]
456-
#[cfg_attr(bootstrap, allow(deprecated_in_future))]
456+
#[allow(deprecated_in_future)]
457457
#[allow(deprecated)]
458458
pub unsafe fn zeroed<T>() -> T {
459459
intrinsics::panic_if_uninhabited::<T>();
@@ -481,7 +481,7 @@ pub unsafe fn zeroed<T>() -> T {
481481
#[inline]
482482
#[rustc_deprecated(since = "1.39.0", reason = "use `mem::MaybeUninit` instead")]
483483
#[stable(feature = "rust1", since = "1.0.0")]
484-
#[cfg_attr(bootstrap, allow(deprecated_in_future))]
484+
#[allow(deprecated_in_future)]
485485
#[allow(deprecated)]
486486
pub unsafe fn uninitialized<T>() -> T {
487487
intrinsics::panic_if_uninhabited::<T>();

0 commit comments

Comments
 (0)