Skip to content

Commit b15ca66

Browse files
committedDec 29, 2022
Auto merge of #105741 - pietroalbini:pa-1.68-nightly, r=Mark-Simulacrum
Bump master bootstrap compiler This PR bumps the bootstrap compiler to the beta created earlier this week, cherry-picks the stabilization version number updates, and updates the `cfg(bootstrap)`s. r? `@Mark-Simulacrum`
2 parents 9709a43 + cc4e434 commit b15ca66

File tree

39 files changed

+451
-1073
lines changed

39 files changed

+451
-1073
lines changed
 

‎compiler/rustc_feature/src/accepted.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ declare_features! (
194194
/// Allows irrefutable patterns in `if let` and `while let` statements (RFC 2086).
195195
(accepted, irrefutable_let_patterns, "1.33.0", Some(44495), None),
196196
/// Allows `#[instruction_set(_)]` attribute.
197-
(accepted, isa_attribute, "CURRENT_RUSTC_VERSION", Some(74727), None),
197+
(accepted, isa_attribute, "1.67.0", Some(74727), None),
198198
/// Allows some increased flexibility in the name resolution rules,
199199
/// especially around globs and shadowing (RFC 1560).
200200
(accepted, item_like_imports, "1.15.0", Some(35120), None),
@@ -240,7 +240,7 @@ declare_features! (
240240
/// Allows specifying the bundle link modifier
241241
(accepted, native_link_modifiers_bundle, "1.63.0", Some(81490), None),
242242
/// Allows specifying the verbatim link modifier
243-
(accepted, native_link_modifiers_verbatim, "CURRENT_RUSTC_VERSION", Some(81490), None),
243+
(accepted, native_link_modifiers_verbatim, "1.67.0", Some(81490), None),
244244
/// Allows specifying the whole-archive link modifier
245245
(accepted, native_link_modifiers_whole_archive, "1.61.0", Some(81490), None),
246246
/// Allows using non lexical lifetimes (RFC 2094).

‎compiler/rustc_feature/src/active.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ declare_features! (
420420
/// Allows `impl Trait` as output type in `Fn` traits in return position of functions.
421421
(active, impl_trait_in_fn_trait_return, "1.64.0", Some(99697), None),
422422
/// Allows referencing `Self` and projections in impl-trait.
423-
(active, impl_trait_projections, "CURRENT_RUSTC_VERSION", Some(103532), None),
423+
(active, impl_trait_projections, "1.67.0", Some(103532), None),
424424
/// Allows using imported `main` function
425425
(active, imported_main, "1.53.0", Some(28937), None),
426426
/// Allows associated types in inherent impls.
@@ -507,7 +507,7 @@ declare_features! (
507507
/// Allows lints part of the strict provenance effort.
508508
(active, strict_provenance, "1.61.0", Some(95228), None),
509509
/// Allows string patterns to dereference values to match them.
510-
(active, string_deref_patterns, "CURRENT_RUSTC_VERSION", Some(87121), None),
510+
(active, string_deref_patterns, "1.67.0", Some(87121), None),
511511
/// Allows the use of `#[target_feature]` on safe functions.
512512
(active, target_feature_11, "1.45.0", Some(69098), None),
513513
/// Allows using `#[thread_local]` on `static` items.

‎compiler/rustc_hir/src/hir.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -3609,16 +3609,9 @@ mod size_asserts {
36093609
static_assert_size!(Res, 12);
36103610
static_assert_size!(Stmt<'_>, 32);
36113611
static_assert_size!(StmtKind<'_>, 16);
3612-
// tidy-alphabetical-end
3613-
// FIXME: move the tidy directive to the end after the next bootstrap bump
3614-
#[cfg(bootstrap)]
3615-
static_assert_size!(TraitItem<'_>, 88);
3616-
#[cfg(not(bootstrap))]
36173612
static_assert_size!(TraitItem<'_>, 80);
3618-
#[cfg(bootstrap)]
3619-
static_assert_size!(TraitItemKind<'_>, 48);
3620-
#[cfg(not(bootstrap))]
36213613
static_assert_size!(TraitItemKind<'_>, 40);
36223614
static_assert_size!(Ty<'_>, 48);
36233615
static_assert_size!(TyKind<'_>, 32);
3616+
// tidy-alphabetical-end
36243617
}

‎library/alloc/src/alloc.rs

-13
Original file line numberDiff line numberDiff line change
@@ -404,19 +404,6 @@ pub mod __alloc_error_handler {
404404
pub unsafe fn __rdl_oom(size: usize, _align: usize) -> ! {
405405
panic!("memory allocation of {size} bytes failed")
406406
}
407-
408-
#[cfg(bootstrap)]
409-
#[rustc_std_internal_symbol]
410-
pub unsafe fn __rg_oom(size: usize, align: usize) -> ! {
411-
use crate::alloc::Layout;
412-
413-
let layout = unsafe { Layout::from_size_align_unchecked(size, align) };
414-
extern "Rust" {
415-
#[lang = "oom"]
416-
fn oom_impl(layout: Layout) -> !;
417-
}
418-
unsafe { oom_impl(layout) }
419-
}
420407
}
421408

422409
/// Specialize clones into pre-allocated, uninitialized memory.

‎library/alloc/src/boxed.rs

-30
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ use core::hash::{Hash, Hasher};
158158
#[cfg(not(no_global_oom_handling))]
159159
use core::iter::FromIterator;
160160
use core::iter::{FusedIterator, Iterator};
161-
#[cfg(not(bootstrap))]
162161
use core::marker::Tuple;
163162
use core::marker::{Destruct, Unpin, Unsize};
164163
use core::mem;
@@ -1981,17 +1980,6 @@ impl<I: ExactSizeIterator + ?Sized, A: Allocator> ExactSizeIterator for Box<I, A
19811980
#[stable(feature = "fused", since = "1.26.0")]
19821981
impl<I: FusedIterator + ?Sized, A: Allocator> FusedIterator for Box<I, A> {}
19831982

1984-
#[cfg(bootstrap)]
1985-
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
1986-
impl<Args, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F, A> {
1987-
type Output = <F as FnOnce<Args>>::Output;
1988-
1989-
extern "rust-call" fn call_once(self, args: Args) -> Self::Output {
1990-
<F as FnOnce<Args>>::call_once(*self, args)
1991-
}
1992-
}
1993-
1994-
#[cfg(not(bootstrap))]
19951983
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
19961984
impl<Args: Tuple, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F, A> {
19971985
type Output = <F as FnOnce<Args>>::Output;
@@ -2001,31 +1989,13 @@ impl<Args: Tuple, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F
20011989
}
20021990
}
20031991

2004-
#[cfg(bootstrap)]
2005-
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
2006-
impl<Args, F: FnMut<Args> + ?Sized, A: Allocator> FnMut<Args> for Box<F, A> {
2007-
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output {
2008-
<F as FnMut<Args>>::call_mut(self, args)
2009-
}
2010-
}
2011-
2012-
#[cfg(not(bootstrap))]
20131992
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
20141993
impl<Args: Tuple, F: FnMut<Args> + ?Sized, A: Allocator> FnMut<Args> for Box<F, A> {
20151994
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output {
20161995
<F as FnMut<Args>>::call_mut(self, args)
20171996
}
20181997
}
20191998

2020-
#[cfg(bootstrap)]
2021-
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
2022-
impl<Args, F: Fn<Args> + ?Sized, A: Allocator> Fn<Args> for Box<F, A> {
2023-
extern "rust-call" fn call(&self, args: Args) -> Self::Output {
2024-
<F as Fn<Args>>::call(self, args)
2025-
}
2026-
}
2027-
2028-
#[cfg(not(bootstrap))]
20291999
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
20302000
impl<Args: Tuple, F: Fn<Args> + ?Sized, A: Allocator> Fn<Args> for Box<F, A> {
20312001
extern "rust-call" fn call(&self, args: Args) -> Self::Output {

‎library/alloc/src/collections/btree/node.rs

+17-11
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,10 @@ impl<BorrowType: marker::BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type>
318318
pub fn ascend(
319319
self,
320320
) -> Result<Handle<NodeRef<BorrowType, K, V, marker::Internal>, marker::Edge>, Self> {
321-
let _ = BorrowType::TRAVERSAL_PERMIT;
321+
const {
322+
assert!(BorrowType::TRAVERSAL_PERMIT);
323+
}
324+
322325
// We need to use raw pointers to nodes because, if BorrowType is marker::ValMut,
323326
// there might be outstanding mutable references to values that we must not invalidate.
324327
let leaf_ptr: *const _ = Self::as_leaf_ptr(&self);
@@ -1003,7 +1006,10 @@ impl<BorrowType: marker::BorrowType, K, V>
10031006
/// `edge.descend().ascend().unwrap()` and `node.ascend().unwrap().descend()` should
10041007
/// both, upon success, do nothing.
10051008
pub fn descend(self) -> NodeRef<BorrowType, K, V, marker::LeafOrInternal> {
1006-
let _ = BorrowType::TRAVERSAL_PERMIT;
1009+
const {
1010+
assert!(BorrowType::TRAVERSAL_PERMIT);
1011+
}
1012+
10071013
// We need to use raw pointers to nodes because, if BorrowType is
10081014
// marker::ValMut, there might be outstanding mutable references to
10091015
// values that we must not invalidate. There's no worry accessing the
@@ -1666,17 +1672,17 @@ pub mod marker {
16661672
pub struct ValMut<'a>(PhantomData<&'a mut ()>);
16671673

16681674
pub trait BorrowType {
1669-
// If node references of this borrow type allow traversing to other
1670-
// nodes in the tree, this constant can be evaluated. Thus reading it
1671-
// serves as a compile-time assertion.
1672-
const TRAVERSAL_PERMIT: () = ();
1675+
/// If node references of this borrow type allow traversing to other
1676+
/// nodes in the tree, this constant is set to `true`. It can be used
1677+
/// for a compile-time assertion.
1678+
const TRAVERSAL_PERMIT: bool = true;
16731679
}
16741680
impl BorrowType for Owned {
1675-
// Reject evaluation, because traversal isn't needed. Instead traversal
1676-
// happens using the result of `borrow_mut`.
1677-
// By disabling traversal, and only creating new references to roots,
1678-
// we know that every reference of the `Owned` type is to a root node.
1679-
const TRAVERSAL_PERMIT: () = panic!();
1681+
/// Reject traversal, because it isn't needed. Instead traversal
1682+
/// happens using the result of `borrow_mut`.
1683+
/// By disabling traversal, and only creating new references to roots,
1684+
/// we know that every reference of the `Owned` type is to a root node.
1685+
const TRAVERSAL_PERMIT: bool = false;
16801686
}
16811687
impl BorrowType for Dying {}
16821688
impl<'a> BorrowType for Immut<'a> {}

‎library/alloc/src/lib.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
#![feature(fmt_internals)]
124124
#![feature(fn_traits)]
125125
#![feature(hasher_prefixfree_extras)]
126+
#![feature(inline_const)]
126127
#![feature(inplace_iteration)]
127128
#![feature(iter_advance_by)]
128129
#![feature(iter_next_chunk)]
@@ -153,7 +154,7 @@
153154
#![feature(trusted_len)]
154155
#![feature(trusted_random_access)]
155156
#![feature(try_trait_v2)]
156-
#![cfg_attr(not(bootstrap), feature(tuple_trait))]
157+
#![feature(tuple_trait)]
157158
#![feature(unchecked_math)]
158159
#![feature(unicode_internals)]
159160
#![feature(unsize)]

‎library/alloc/src/string.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ use crate::vec::Vec;
363363
/// [`as_str()`]: String::as_str
364364
#[derive(PartialOrd, Eq, Ord)]
365365
#[stable(feature = "rust1", since = "1.0.0")]
366-
#[cfg_attr(all(not(bootstrap), not(test)), lang = "String")]
366+
#[cfg_attr(not(test), lang = "String")]
367367
pub struct String {
368368
vec: Vec<u8>,
369369
}

‎library/core/src/char/methods.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl char {
140140
/// assert_eq!(None, c);
141141
/// ```
142142
#[stable(feature = "assoc_char_funcs", since = "1.52.0")]
143-
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
143+
#[rustc_const_stable(feature = "const_char_convert", since = "1.67.0")]
144144
#[must_use]
145145
#[inline]
146146
pub const fn from_u32(i: u32) -> Option<char> {
@@ -241,7 +241,7 @@ impl char {
241241
/// let _c = char::from_digit(1, 37);
242242
/// ```
243243
#[stable(feature = "assoc_char_funcs", since = "1.52.0")]
244-
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
244+
#[rustc_const_stable(feature = "const_char_convert", since = "1.67.0")]
245245
#[must_use]
246246
#[inline]
247247
pub const fn from_digit(num: u32, radix: u32) -> Option<char> {
@@ -338,7 +338,7 @@ impl char {
338338
/// let _ = '1'.to_digit(37);
339339
/// ```
340340
#[stable(feature = "rust1", since = "1.0.0")]
341-
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
341+
#[rustc_const_stable(feature = "const_char_convert", since = "1.67.0")]
342342
#[must_use = "this returns the result of the operation, \
343343
without modifying the original"]
344344
#[inline]

‎library/core/src/char/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub fn decode_utf16<I: IntoIterator<Item = u16>>(iter: I) -> DecodeUtf16<I::Into
110110

111111
/// Converts a `u32` to a `char`. Use [`char::from_u32`] instead.
112112
#[stable(feature = "rust1", since = "1.0.0")]
113-
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
113+
#[rustc_const_stable(feature = "const_char_convert", since = "1.67.0")]
114114
#[must_use]
115115
#[inline]
116116
pub const fn from_u32(i: u32) -> Option<char> {
@@ -130,7 +130,7 @@ pub const unsafe fn from_u32_unchecked(i: u32) -> char {
130130

131131
/// Converts a digit in the given radix to a `char`. Use [`char::from_digit`] instead.
132132
#[stable(feature = "rust1", since = "1.0.0")]
133-
#[rustc_const_stable(feature = "const_char_convert", since = "CURRENT_RUSTC_VERSION")]
133+
#[rustc_const_stable(feature = "const_char_convert", since = "1.67.0")]
134134
#[must_use]
135135
#[inline]
136136
pub const fn from_digit(num: u32, radix: u32) -> Option<char> {

‎library/core/src/cmp.rs

+1-37
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
use crate::const_closure::ConstFnMutClosure;
2626
use crate::marker::Destruct;
27-
#[cfg(bootstrap)]
28-
use crate::marker::StructuralPartialEq;
2927

3028
use self::Ordering::*;
3129

@@ -333,7 +331,7 @@ pub struct AssertParamIsEq<T: Eq + ?Sized> {
333331
/// assert_eq!(Ordering::Greater, result);
334332
/// ```
335333
#[derive(Clone, Copy, Eq, Debug, Hash)]
336-
#[cfg_attr(not(bootstrap), derive_const(PartialOrd, Ord, PartialEq))]
334+
#[derive_const(PartialOrd, Ord, PartialEq)]
337335
#[stable(feature = "rust1", since = "1.0.0")]
338336
#[repr(i8)]
339337
pub enum Ordering {
@@ -879,40 +877,6 @@ pub macro Ord($item:item) {
879877
/* compiler built-in */
880878
}
881879

882-
#[stable(feature = "rust1", since = "1.0.0")]
883-
#[cfg(bootstrap)]
884-
impl StructuralPartialEq for Ordering {}
885-
886-
#[stable(feature = "rust1", since = "1.0.0")]
887-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
888-
#[cfg(bootstrap)]
889-
impl const PartialEq for Ordering {
890-
#[inline]
891-
fn eq(&self, other: &Self) -> bool {
892-
(*self as i32).eq(&(*other as i32))
893-
}
894-
}
895-
896-
#[stable(feature = "rust1", since = "1.0.0")]
897-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
898-
#[cfg(bootstrap)]
899-
impl const Ord for Ordering {
900-
#[inline]
901-
fn cmp(&self, other: &Ordering) -> Ordering {
902-
(*self as i32).cmp(&(*other as i32))
903-
}
904-
}
905-
906-
#[stable(feature = "rust1", since = "1.0.0")]
907-
#[rustc_const_unstable(feature = "const_cmp", issue = "92391")]
908-
#[cfg(bootstrap)]
909-
impl const PartialOrd for Ordering {
910-
#[inline]
911-
fn partial_cmp(&self, other: &Ordering) -> Option<Ordering> {
912-
(*self as i32).partial_cmp(&(*other as i32))
913-
}
914-
}
915-
916880
/// Trait for types that form a [partial order](https://en.wikipedia.org/wiki/Partial_order).
917881
///
918882
/// The `lt`, `le`, `gt`, and `ge` methods of this trait can be called using

‎library/core/src/const_closure.rs

-29
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::marker::Destruct;
2-
#[cfg(not(bootstrap))]
32
use crate::marker::Tuple;
43

54
/// Struct representing a closure with mutably borrowed data.
@@ -46,33 +45,6 @@ impl<'a, CapturedData: ?Sized, Function> ConstFnMutClosure<&'a mut CapturedData,
4645

4746
macro_rules! impl_fn_mut_tuple {
4847
($($var:ident)*) => {
49-
#[cfg(bootstrap)]
50-
#[allow(unused_parens)]
51-
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
52-
FnOnce<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
53-
where
54-
Function: ~const Fn(($(&mut $var),*), ClosureArguments) -> ClosureReturnValue + ~const Destruct,
55-
{
56-
type Output = ClosureReturnValue;
57-
58-
extern "rust-call" fn call_once(mut self, args: ClosureArguments) -> Self::Output {
59-
self.call_mut(args)
60-
}
61-
}
62-
#[cfg(bootstrap)]
63-
#[allow(unused_parens)]
64-
impl<'a, $($var,)* ClosureArguments, Function, ClosureReturnValue> const
65-
FnMut<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
66-
where
67-
Function: ~const Fn(($(&mut $var),*), ClosureArguments)-> ClosureReturnValue + ~const Destruct,
68-
{
69-
extern "rust-call" fn call_mut(&mut self, args: ClosureArguments) -> Self::Output {
70-
#[allow(non_snake_case)]
71-
let ($($var),*) = &mut self.data;
72-
(self.func)(($($var),*), args)
73-
}
74-
}
75-
#[cfg(not(bootstrap))]
7648
#[allow(unused_parens)]
7749
impl<'a, $($var,)* ClosureArguments: Tuple, Function, ClosureReturnValue> const
7850
FnOnce<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>
@@ -85,7 +57,6 @@ macro_rules! impl_fn_mut_tuple {
8557
self.call_mut(args)
8658
}
8759
}
88-
#[cfg(not(bootstrap))]
8960
#[allow(unused_parens)]
9061
impl<'a, $($var,)* ClosureArguments: Tuple, Function, ClosureReturnValue> const
9162
FnMut<ClosureArguments> for ConstFnMutClosure<($(&'a mut $var),*), Function>

‎library/core/src/future/mod.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub use poll_fn::{poll_fn, PollFn};
4444
/// non-Send/Sync as well, and we don't want that.
4545
///
4646
/// It also simplifies the HIR lowering of `.await`.
47-
#[cfg_attr(not(bootstrap), lang = "ResumeTy")]
47+
#[lang = "ResumeTy"]
4848
#[doc(hidden)]
4949
#[unstable(feature = "gen_future", issue = "50547")]
5050
#[derive(Debug, Copy, Clone)]
@@ -61,7 +61,6 @@ unsafe impl Sync for ResumeTy {}
6161
/// This function returns a `GenFuture` underneath, but hides it in `impl Trait` to give
6262
/// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`).
6363
// This is `const` to avoid extra errors after we recover from `const async fn`
64-
#[cfg_attr(bootstrap, lang = "from_generator")]
6564
#[doc(hidden)]
6665
#[unstable(feature = "gen_future", issue = "50547")]
6766
#[rustc_const_unstable(feature = "gen_future", issue = "50547")]
@@ -113,10 +112,10 @@ pub unsafe fn get_context<'a, 'b>(cx: ResumeTy) -> &'a mut Context<'b> {
113112
unsafe { &mut *cx.0.as_ptr().cast() }
114113
}
115114

116-
#[cfg_attr(not(bootstrap), lang = "identity_future")]
117115
#[doc(hidden)]
118116
#[unstable(feature = "gen_future", issue = "50547")]
119117
#[inline]
118+
#[lang = "identity_future"]
120119
pub const fn identity_future<O, Fut: Future<Output = O>>(f: Fut) -> Fut {
121120
f
122121
}

0 commit comments

Comments
 (0)
Please sign in to comment.