Skip to content

Commit dc1d9d5

Browse files
committed
Auto merge of rust-lang#107297 - Mark-Simulacrum:bump-bootstrap, r=pietroalbini
Bump bootstrap compiler to 1.68 This also changes our stage0.json to include the rustc component for the rustfmt pinned nightly toolchain, which is currently necessary due to rustfmt dynamically linking to that toolchain's librustc_driver and libstd. r? `@pietroalbini`
2 parents f361413 + 652f79e commit dc1d9d5

File tree

21 files changed

+447
-425
lines changed

21 files changed

+447
-425
lines changed

compiler/rustc_const_eval/src/interpret/intern.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ use super::{
3030
use crate::const_eval;
3131

3232
pub trait CompileTimeMachine<'mir, 'tcx, T> = Machine<
33-
'mir,
34-
'tcx,
35-
MemoryKind = T,
36-
Provenance = AllocId,
37-
ExtraFnVal = !,
38-
FrameExtra = (),
39-
AllocExtra = (),
40-
MemoryMap = FxIndexMap<AllocId, (MemoryKind<T>, Allocation)>,
41-
>;
33+
'mir,
34+
'tcx,
35+
MemoryKind = T,
36+
Provenance = AllocId,
37+
ExtraFnVal = !,
38+
FrameExtra = (),
39+
AllocExtra = (),
40+
MemoryMap = FxIndexMap<AllocId, (MemoryKind<T>, Allocation)>,
41+
>;
4242

4343
struct InternVisitor<'rt, 'mir, 'tcx, M: CompileTimeMachine<'mir, 'tcx, const_eval::MemoryKind>> {
4444
/// The ectx from which we intern.

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,7 @@ pub trait ForestObligation: Clone + Debug {
9595
pub trait ObligationProcessor {
9696
type Obligation: ForestObligation;
9797
type Error: Debug;
98-
type OUT: OutcomeTrait<
99-
Obligation = Self::Obligation,
100-
Error = Error<Self::Obligation, Self::Error>,
101-
>;
98+
type OUT: OutcomeTrait<Obligation = Self::Obligation, Error = Error<Self::Obligation, Self::Error>>;
10299

103100
fn needs_process_obligation(&self, obligation: &Self::Obligation) -> bool;
104101

compiler/rustc_feature/src/accepted.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ declare_features! (
4949
/// Allows `#[target_feature(...)]` on aarch64 platforms
5050
(accepted, aarch64_target_feature, "1.61.0", Some(44839), None),
5151
/// Allows using the `efiapi` ABI.
52-
(accepted, abi_efiapi, "CURRENT_RUSTC_VERSION", Some(65815), None),
52+
(accepted, abi_efiapi, "1.68.0", Some(65815), None),
5353
/// Allows the sysV64 ABI to be specified on all platforms
5454
/// instead of just the platforms on which it is the C ABI.
5555
(accepted, abi_sysv64, "1.24.0", Some(36167), None),
@@ -129,7 +129,7 @@ declare_features! (
129129
/// Allows `crate` in paths.
130130
(accepted, crate_in_paths, "1.30.0", Some(45477), None),
131131
/// Allows rustc to inject a default alloc_error_handler
132-
(accepted, default_alloc_error_handler, "CURRENT_RUSTC_VERSION", Some(66741), None),
132+
(accepted, default_alloc_error_handler, "1.68.0", Some(66741), None),
133133
/// Allows using assigning a default type to type parameters in algebraic data type definitions.
134134
(accepted, default_type_params, "1.0.0", None, None),
135135
/// Allows `#[deprecated]` attribute.
@@ -164,7 +164,7 @@ declare_features! (
164164
/// Allows access to crate names passed via `--extern` through prelude.
165165
(accepted, extern_prelude, "1.30.0", Some(44660), None),
166166
/// Allows using F16C intrinsics from `core::arch::{x86, x86_64}`.
167-
(accepted, f16c_target_feature, "CURRENT_RUSTC_VERSION", Some(44839), None),
167+
(accepted, f16c_target_feature, "1.68.0", Some(44839), None),
168168
/// Allows field shorthands (`x` meaning `x: x`) in struct literal expressions.
169169
(accepted, field_init_shorthand, "1.17.0", Some(37340), None),
170170
/// Allows `#[must_use]` on functions, and introduces must-use operators (RFC 1940).

compiler/rustc_feature/src/active.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ declare_features! (
342342
/// Allows `async {}` expressions in const contexts.
343343
(active, const_async_blocks, "1.53.0", Some(85368), None),
344344
/// Allows `const || {}` closures in const contexts.
345-
(incomplete, const_closures, "CURRENT_RUSTC_VERSION", Some(106003), None),
345+
(incomplete, const_closures, "1.68.0", Some(106003), None),
346346
/// Allows limiting the evaluation steps of const expressions
347347
(active, const_eval_limit, "1.43.0", Some(67217), None),
348348
/// Allows the definition of `const extern fn` and `const unsafe extern fn`.

library/alloc/src/collections/vec_deque/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ impl<T> VecDeque<T> {
537537
/// ```
538538
#[inline]
539539
#[stable(feature = "rust1", since = "1.0.0")]
540-
#[rustc_const_stable(feature = "const_vec_deque_new", since = "CURRENT_RUSTC_VERSION")]
540+
#[rustc_const_stable(feature = "const_vec_deque_new", since = "1.68.0")]
541541
#[must_use]
542542
pub const fn new() -> VecDeque<T> {
543543
// FIXME: This should just be `VecDeque::new_in(Global)` once that hits stable.

library/alloc/src/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2549,7 +2549,7 @@ impl ToString for char {
25492549
}
25502550

25512551
#[cfg(not(no_global_oom_handling))]
2552-
#[stable(feature = "bool_to_string_specialization", since = "CURRENT_RUSTC_VERSION")]
2552+
#[stable(feature = "bool_to_string_specialization", since = "1.68.0")]
25532553
impl ToString for bool {
25542554
#[inline]
25552555
fn to_string(&self) -> String {

library/core/src/cmp.rs

+3-37
Original file line numberDiff line numberDiff line change
@@ -798,16 +798,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
798798
Self: Sized,
799799
Self: ~const Destruct,
800800
{
801-
#[cfg(not(bootstrap))]
802-
{
803-
max_by(self, other, Ord::cmp)
804-
}
805-
806-
#[cfg(bootstrap)]
807-
match self.cmp(&other) {
808-
Ordering::Less | Ordering::Equal => other,
809-
Ordering::Greater => self,
810-
}
801+
max_by(self, other, Ord::cmp)
811802
}
812803

813804
/// Compares and returns the minimum of two values.
@@ -828,16 +819,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
828819
Self: Sized,
829820
Self: ~const Destruct,
830821
{
831-
#[cfg(not(bootstrap))]
832-
{
833-
min_by(self, other, Ord::cmp)
834-
}
835-
836-
#[cfg(bootstrap)]
837-
match self.cmp(&other) {
838-
Ordering::Less | Ordering::Equal => self,
839-
Ordering::Greater => other,
840-
}
822+
min_by(self, other, Ord::cmp)
841823
}
842824

843825
/// Restrict a value to a certain interval.
@@ -1234,23 +1216,7 @@ where
12341216
F: ~const Destruct,
12351217
K: ~const Destruct,
12361218
{
1237-
cfg_if! {
1238-
if #[cfg(bootstrap)] {
1239-
const fn imp<T, F: ~const FnMut(&T) -> K, K: ~const Ord>(
1240-
f: &mut F,
1241-
(v1, v2): (&T, &T),
1242-
) -> Ordering
1243-
where
1244-
T: ~const Destruct,
1245-
K: ~const Destruct,
1246-
{
1247-
f(v1).cmp(&f(v2))
1248-
}
1249-
min_by(v1, v2, ConstFnMutClosure::new(&mut f, imp))
1250-
} else {
1251-
min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
1252-
}
1253-
}
1219+
min_by(v1, v2, const |v1, v2| f(v1).cmp(&f(v2)))
12541220
}
12551221

12561222
/// Compares and returns the maximum of two values.

library/core/src/convert/num.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl_from! { u32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0"
169169
impl_from! { f32, f64, #[stable(feature = "lossless_float_conv", since = "1.6.0")] }
170170

171171
// bool -> Float
172-
#[stable(feature = "float_from_bool", since = "CURRENT_RUSTC_VERSION")]
172+
#[stable(feature = "float_from_bool", since = "1.68.0")]
173173
#[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
174174
impl const From<bool> for f32 {
175175
/// Converts `bool` to `f32` losslessly.
@@ -178,7 +178,7 @@ impl const From<bool> for f32 {
178178
small as u8 as Self
179179
}
180180
}
181-
#[stable(feature = "float_from_bool", since = "CURRENT_RUSTC_VERSION")]
181+
#[stable(feature = "float_from_bool", since = "1.68.0")]
182182
#[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
183183
impl const From<bool> for f64 {
184184
/// Converts `bool` to `f64` losslessly.

library/core/src/intrinsics.rs

-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ use crate::marker::DiscriminantKind;
5858
use crate::marker::Tuple;
5959
use crate::mem;
6060

61-
#[cfg(not(bootstrap))]
6261
pub mod mir;
6362

6463
// These imports are used for simplifying intra-doc links
@@ -963,7 +962,6 @@ extern "rust-intrinsic" {
963962
/// This intrinsic does not have a stable counterpart.
964963
#[rustc_const_unstable(feature = "const_assert_type2", issue = "none")]
965964
#[rustc_safe_intrinsic]
966-
#[cfg(not(bootstrap))]
967965
pub fn assert_mem_uninitialized_valid<T>();
968966

969967
/// Gets a reference to a static `Location` indicating where it was called.

library/core/src/intrinsics/mir.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
6060
//!
6161
//! # Examples
6262
//!
63-
#![cfg_attr(bootstrap, doc = "```rust,compile_fail")]
64-
#![cfg_attr(not(bootstrap), doc = "```rust")]
63+
//! ```rust
6564
//! #![feature(core_intrinsics, custom_mir)]
6665
//!
6766
//! extern crate core;
@@ -300,8 +299,7 @@ define!(
300299
///
301300
/// # Examples
302301
///
303-
#[cfg_attr(bootstrap, doc = "```rust,compile_fail")]
304-
#[cfg_attr(not(bootstrap), doc = "```rust")]
302+
/// ```rust
305303
/// #![feature(custom_mir, core_intrinsics)]
306304
///
307305
/// extern crate core;

library/core/src/iter/sources/once_with.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub struct OnceWith<F> {
7373
gen: Option<F>,
7474
}
7575

76-
#[stable(feature = "iter_once_with_debug", since = "CURRENT_RUSTC_VERSION")]
76+
#[stable(feature = "iter_once_with_debug", since = "1.68.0")]
7777
impl<F> fmt::Debug for OnceWith<F> {
7878
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
7979
if self.gen.is_some() {

library/core/src/iter/sources/repeat_with.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pub struct RepeatWith<F> {
7878
repeater: F,
7979
}
8080

81-
#[stable(feature = "iterator_repeat_with_debug", since = "CURRENT_RUSTC_VERSION")]
81+
#[stable(feature = "iterator_repeat_with_debug", since = "1.68.0")]
8282
impl<F> fmt::Debug for RepeatWith<F> {
8383
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
8484
f.debug_struct("RepeatWith").finish_non_exhaustive()

library/core/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
#![feature(cfg_sanitize)]
193193
#![feature(cfg_target_has_atomic)]
194194
#![feature(cfg_target_has_atomic_equal_alignment)]
195-
#![cfg_attr(not(bootstrap), feature(const_closures))]
195+
#![feature(const_closures)]
196196
#![feature(const_fn_floating_point_arithmetic)]
197197
#![feature(const_mut_refs)]
198198
#![feature(const_precise_live_drops)]
@@ -250,7 +250,6 @@
250250
#![feature(sse4a_target_feature)]
251251
#![feature(tbm_target_feature)]
252252
#![feature(wasm_target_feature)]
253-
#![cfg_attr(bootstrap, feature(f16c_target_feature))]
254253

255254
// allow using `core::` in intra-doc links
256255
#[allow(unused_extern_crates)]

library/core/src/mem/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,6 @@ pub unsafe fn zeroed<T>() -> T {
682682
pub unsafe fn uninitialized<T>() -> T {
683683
// SAFETY: the caller must guarantee that an uninitialized value is valid for `T`.
684684
unsafe {
685-
#[cfg(not(bootstrap))] // If the compiler hits this itself then it deserves the UB.
686685
intrinsics::assert_mem_uninitialized_valid::<T>();
687686
let mut val = MaybeUninit::<T>::uninit();
688687

library/core/src/panicking.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub const fn panic(expr: &'static str) -> ! {
117117
/// Like `panic`, but without unwinding and track_caller to reduce the impact on codesize.
118118
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
119119
#[cfg_attr(feature = "panic_immediate_abort", inline)]
120-
#[cfg_attr(not(bootstrap), lang = "panic_nounwind")] // needed by codegen for non-unwinding panics
120+
#[lang = "panic_nounwind"] // needed by codegen for non-unwinding panics
121121
#[rustc_nounwind]
122122
pub fn panic_nounwind(expr: &'static str) -> ! {
123123
panic_nounwind_fmt(fmt::Arguments::new_v1(&[expr], &[]));
@@ -165,8 +165,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
165165
/// any extra arguments (including those synthesized by track_caller).
166166
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
167167
#[cfg_attr(feature = "panic_immediate_abort", inline)]
168-
#[cfg_attr(bootstrap, lang = "panic_no_unwind")] // needed by codegen for panic in nounwind function
169-
#[cfg_attr(not(bootstrap), lang = "panic_cannot_unwind")] // needed by codegen for panic in nounwind function
168+
#[lang = "panic_cannot_unwind"] // needed by codegen for panic in nounwind function
170169
#[rustc_nounwind]
171170
fn panic_cannot_unwind() -> ! {
172171
panic_nounwind("panic in a function that cannot unwind")

library/core/src/pin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ impl<P, U> DispatchFromDyn<Pin<U>> for Pin<P> where P: DispatchFromDyn<U> {}
11641164
/// constructor.
11651165
///
11661166
/// [`Box::pin`]: ../../std/boxed/struct.Box.html#method.pin
1167-
#[stable(feature = "pin_macro", since = "CURRENT_RUSTC_VERSION")]
1167+
#[stable(feature = "pin_macro", since = "1.68.0")]
11681168
#[rustc_macro_transparency = "semitransparent"]
11691169
#[allow_internal_unstable(unsafe_pin_internals)]
11701170
pub macro pin($value:expr $(,)?) {

library/core/src/task/wake.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ impl RawWakerVTable {
174174
/// Currently, `Context` only serves to provide access to a [`&Waker`](Waker)
175175
/// which can be used to wake the current task.
176176
#[stable(feature = "futures_api", since = "1.36.0")]
177-
#[cfg_attr(not(bootstrap), lang = "Context")]
177+
#[lang = "Context"]
178178
pub struct Context<'a> {
179179
waker: &'a Waker,
180180
// Ensure we future-proof against variance changes by forcing

library/std/src/path.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ pub const MAIN_SEPARATOR: char = crate::sys::path::MAIN_SEP;
271271
/// The primary separator of path components for the current platform.
272272
///
273273
/// For example, `/` on Unix and `\` on Windows.
274-
#[stable(feature = "main_separator_str", since = "CURRENT_RUSTC_VERSION")]
274+
#[stable(feature = "main_separator_str", since = "1.68.0")]
275275
pub const MAIN_SEPARATOR_STR: &str = crate::sys::path::MAIN_SEP_STR;
276276

277277
////////////////////////////////////////////////////////////////////////////////
@@ -1778,7 +1778,7 @@ impl ops::Deref for PathBuf {
17781778
}
17791779
}
17801780

1781-
#[stable(feature = "path_buf_deref_mut", since = "CURRENT_RUSTC_VERSION")]
1781+
#[stable(feature = "path_buf_deref_mut", since = "1.68.0")]
17821782
impl ops::DerefMut for PathBuf {
17831783
#[inline]
17841784
fn deref_mut(&mut self) -> &mut Path {

src/bootstrap/download.rs

+16-4
Original file line numberDiff line numberDiff line change
@@ -318,15 +318,27 @@ impl Config {
318318
let channel = format!("{version}-{date}");
319319

320320
let host = self.build;
321-
let rustfmt_path = self.initial_rustc.with_file_name(exe("rustfmt", host));
322-
let bin_root = self.out.join(host.triple).join("stage0");
321+
let bin_root = self.out.join(host.triple).join("rustfmt");
322+
let rustfmt_path = bin_root.join("bin").join(exe("rustfmt", host));
323323
let rustfmt_stamp = bin_root.join(".rustfmt-stamp");
324324
if rustfmt_path.exists() && !program_out_of_date(&rustfmt_stamp, &channel) {
325325
return Some(rustfmt_path);
326326
}
327327

328-
let filename = format!("rustfmt-{version}-{build}.tar.xz", build = host.triple);
329-
self.download_component(DownloadSource::Dist, filename, "rustfmt-preview", &date, "stage0");
328+
self.download_component(
329+
DownloadSource::Dist,
330+
format!("rustfmt-{version}-{build}.tar.xz", build = host.triple),
331+
"rustfmt-preview",
332+
&date,
333+
"rustfmt",
334+
);
335+
self.download_component(
336+
DownloadSource::Dist,
337+
format!("rustc-{version}-{build}.tar.xz", build = host.triple),
338+
"rustc",
339+
&date,
340+
"rustfmt",
341+
);
330342

331343
self.fix_bin_or_dylib(&bin_root.join("bin").join("rustfmt"));
332344
self.fix_bin_or_dylib(&bin_root.join("bin").join("cargo-fmt"));

0 commit comments

Comments
 (0)