Skip to content

Commit 1e8dd37

Browse files
authored
Rollup merge of #64764 - Mark-Simulacrum:snap, r=Centril
Master is now 1.40 r? @pietroalbini
2 parents a1b5dfa + f359a94 commit 1e8dd37

File tree

28 files changed

+18
-107
lines changed

28 files changed

+18
-107
lines changed

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

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

src/liballoc/alloc.rs

-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ pub(crate) unsafe fn box_free<T: ?Sized>(ptr: Unique<T>) {
240240
#[stable(feature = "global_alloc", since = "1.28.0")]
241241
#[rustc_allocator_nounwind]
242242
pub fn handle_alloc_error(layout: Layout) -> ! {
243-
#[cfg_attr(bootstrap, allow(improper_ctypes))]
244243
extern "Rust" {
245244
#[lang = "oom"]
246245
fn oom_impl(layout: Layout) -> !;

src/liballoc/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@
117117
#![feature(allocator_internals)]
118118
#![feature(on_unimplemented)]
119119
#![feature(rustc_const_unstable)]
120-
#![cfg_attr(bootstrap, feature(const_vec_new))]
121120
#![feature(slice_partition_dedup)]
122121
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
123122
#![feature(alloc_layout_extra)]

src/liballoc/string.rs

-1
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ impl String {
369369
/// ```
370370
#[inline]
371371
#[stable(feature = "rust1", since = "1.0.0")]
372-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_string_new"))]
373372
pub const fn new() -> String {
374373
String { vec: Vec::new() }
375374
}

src/liballoc/vec.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ use crate::raw_vec::RawVec;
291291
/// [`reserve`]: ../../std/vec/struct.Vec.html#method.reserve
292292
/// [owned slice]: ../../std/boxed/struct.Box.html
293293
#[stable(feature = "rust1", since = "1.0.0")]
294-
#[cfg_attr(all(not(bootstrap), not(test)), rustc_diagnostic_item = "vec_type")]
294+
#[cfg_attr(not(test), rustc_diagnostic_item = "vec_type")]
295295
pub struct Vec<T> {
296296
buf: RawVec<T>,
297297
len: usize,
@@ -314,7 +314,6 @@ impl<T> Vec<T> {
314314
/// ```
315315
#[inline]
316316
#[stable(feature = "rust1", since = "1.0.0")]
317-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_vec_new"))]
318317
pub const fn new() -> Vec<T> {
319318
Vec {
320319
buf: RawVec::NEW,

src/libcore/bool.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! impl bool {}
22
3-
#[cfg(not(bootstrap))]
43
#[lang = "bool"]
54
impl bool {
65
/// Returns `Some(t)` if the `bool` is `true`, or `None` otherwise.

src/libcore/clone.rs

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

136136
/// Derive macro generating an impl of the trait `Clone`.
137137
#[rustc_builtin_macro]
138-
#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")]
139138
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
140139
#[allow_internal_unstable(core_intrinsics, derive_clone_copy)]
141140
pub macro Clone($item:item) { /* compiler built-in */ }

src/libcore/cmp.rs

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

211211
/// Derive macro generating an impl of the trait `PartialEq`.
212212
#[rustc_builtin_macro]
213-
#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")]
214213
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
215214
#[allow_internal_unstable(core_intrinsics)]
216215
pub macro PartialEq($item:item) { /* compiler built-in */ }
@@ -273,7 +272,6 @@ pub trait Eq: PartialEq<Self> {
273272

274273
/// Derive macro generating an impl of the trait `Eq`.
275274
#[rustc_builtin_macro]
276-
#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")]
277275
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
278276
#[allow_internal_unstable(core_intrinsics, derive_eq)]
279277
pub macro Eq($item:item) { /* compiler built-in */ }
@@ -624,7 +622,6 @@ pub trait Ord: Eq + PartialOrd<Self> {
624622

625623
/// Derive macro generating an impl of the trait `Ord`.
626624
#[rustc_builtin_macro]
627-
#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")]
628625
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
629626
#[allow_internal_unstable(core_intrinsics)]
630627
pub macro Ord($item:item) { /* compiler built-in */ }
@@ -873,7 +870,6 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
873870

874871
/// Derive macro generating an impl of the trait `PartialOrd`.
875872
#[rustc_builtin_macro]
876-
#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")]
877873
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
878874
#[allow_internal_unstable(core_intrinsics)]
879875
pub macro PartialOrd($item:item) { /* compiler built-in */ }

src/libcore/default.rs

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

118118
/// Derive macro generating an impl of the trait `Default`.
119119
#[rustc_builtin_macro]
120-
#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")]
121120
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
122121
#[allow_internal_unstable(core_intrinsics)]
123122
pub macro Default($item:item) { /* compiler built-in */ }

src/libcore/fmt/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,7 @@ impl Display for Arguments<'_> {
518518
label="`{Self}` cannot be formatted using `{{:?}}` because it doesn't implement `{Debug}`",
519519
)]
520520
#[doc(alias = "{:?}")]
521-
#[cfg_attr(bootstrap, lang = "debug_trait")]
522-
#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "debug_trait")]
521+
#[rustc_diagnostic_item = "debug_trait"]
523522
pub trait Debug {
524523
/// Formats the value using the given formatter.
525524
///
@@ -550,7 +549,6 @@ pub trait Debug {
550549
pub(crate) mod macros {
551550
/// Derive macro generating an impl of the trait `Debug`.
552551
#[rustc_builtin_macro]
553-
#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")]
554552
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
555553
#[allow_internal_unstable(core_intrinsics)]
556554
pub macro Debug($item:item) { /* compiler built-in */ }

src/libcore/hash/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ pub trait Hash {
202202
pub(crate) mod macros {
203203
/// Derive macro generating an impl of the trait `Hash`.
204204
#[rustc_builtin_macro]
205-
#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")]
206205
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
207206
#[allow_internal_unstable(core_intrinsics)]
208207
pub macro Hash($item:item) { /* compiler built-in */ }

src/libcore/intrinsics.rs

-22
Original file line numberDiff line numberDiff line change
@@ -1299,38 +1299,16 @@ extern "rust-intrinsic" {
12991299
/// The stabilized versions of this intrinsic are available on the integer
13001300
/// primitives via the `wrapping_add` method. For example,
13011301
/// [`std::u32::wrapping_add`](../../std/primitive.u32.html#method.wrapping_add)
1302-
#[cfg(bootstrap)]
1303-
pub fn overflowing_add<T>(a: T, b: T) -> T;
1304-
/// Returns (a - b) mod 2<sup>N</sup>, where N is the width of T in bits.
1305-
/// The stabilized versions of this intrinsic are available on the integer
1306-
/// primitives via the `wrapping_sub` method. For example,
1307-
/// [`std::u32::wrapping_sub`](../../std/primitive.u32.html#method.wrapping_sub)
1308-
#[cfg(bootstrap)]
1309-
pub fn overflowing_sub<T>(a: T, b: T) -> T;
1310-
/// Returns (a * b) mod 2<sup>N</sup>, where N is the width of T in bits.
1311-
/// The stabilized versions of this intrinsic are available on the integer
1312-
/// primitives via the `wrapping_mul` method. For example,
1313-
/// [`std::u32::wrapping_mul`](../../std/primitive.u32.html#method.wrapping_mul)
1314-
#[cfg(bootstrap)]
1315-
pub fn overflowing_mul<T>(a: T, b: T) -> T;
1316-
1317-
/// Returns (a + b) mod 2<sup>N</sup>, where N is the width of T in bits.
1318-
/// The stabilized versions of this intrinsic are available on the integer
1319-
/// primitives via the `wrapping_add` method. For example,
1320-
/// [`std::u32::wrapping_add`](../../std/primitive.u32.html#method.wrapping_add)
1321-
#[cfg(not(bootstrap))]
13221302
pub fn wrapping_add<T>(a: T, b: T) -> T;
13231303
/// Returns (a - b) mod 2<sup>N</sup>, where N is the width of T in bits.
13241304
/// The stabilized versions of this intrinsic are available on the integer
13251305
/// primitives via the `wrapping_sub` method. For example,
13261306
/// [`std::u32::wrapping_sub`](../../std/primitive.u32.html#method.wrapping_sub)
1327-
#[cfg(not(bootstrap))]
13281307
pub fn wrapping_sub<T>(a: T, b: T) -> T;
13291308
/// Returns (a * b) mod 2<sup>N</sup>, where N is the width of T in bits.
13301309
/// The stabilized versions of this intrinsic are available on the integer
13311310
/// primitives via the `wrapping_mul` method. For example,
13321311
/// [`std::u32::wrapping_mul`](../../std/primitive.u32.html#method.wrapping_mul)
1333-
#[cfg(not(bootstrap))]
13341312
pub fn wrapping_mul<T>(a: T, b: T) -> T;
13351313

13361314
/// Computes `a + b`, while saturating at numeric bounds.

src/libcore/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
#![feature(link_llvm_intrinsics)]
8888
#![feature(never_type)]
8989
#![feature(nll)]
90-
#![cfg_attr(bootstrap, feature(bind_by_move_pattern_guards))]
9190
#![feature(exhaustive_patterns)]
9291
#![feature(no_core)]
9392
#![feature(on_unimplemented)]
@@ -120,9 +119,6 @@
120119
#![feature(rtm_target_feature)]
121120
#![feature(f16c_target_feature)]
122121
#![feature(hexagon_target_feature)]
123-
#![cfg_attr(bootstrap, feature(const_slice_len))]
124-
#![cfg_attr(bootstrap, feature(const_str_as_bytes))]
125-
#![cfg_attr(bootstrap, feature(const_str_len))]
126122
#![feature(const_int_conversion)]
127123
#![feature(const_transmute)]
128124
#![feature(non_exhaustive)]

src/libcore/macros.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1236,10 +1236,8 @@ pub(crate) mod builtin {
12361236
pub macro test($item:item) { /* compiler built-in */ }
12371237

12381238
/// Attribute macro applied to a function to turn it into a benchmark test.
1239-
#[cfg_attr(not(bootstrap), unstable(soft, feature = "test", issue = "50297",
1240-
reason = "`bench` is a part of custom test frameworks which are unstable"))]
1241-
#[cfg_attr(bootstrap, unstable(feature = "test", issue = "50297",
1242-
reason = "`bench` is a part of custom test frameworks which are unstable"))]
1239+
#[unstable(soft, feature = "test", issue = "50297",
1240+
reason = "`bench` is a part of custom test frameworks which are unstable")]
12431241
#[allow_internal_unstable(test, rustc_attrs)]
12441242
#[rustc_builtin_macro]
12451243
pub macro bench($item:item) { /* compiler built-in */ }

src/libcore/marker.rs

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

291291
/// Derive macro generating an impl of the trait `Copy`.
292292
#[rustc_builtin_macro]
293-
#[cfg_attr(bootstrap, rustc_macro_transparency = "semitransparent")]
294293
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
295294
#[allow_internal_unstable(core_intrinsics, derive_clone_copy)]
296295
pub macro Copy($item:item) { /* compiler built-in */ }

src/libcore/num/mod.rs

+6-42
Original file line numberDiff line numberDiff line change
@@ -1112,13 +1112,7 @@ $EndFeature, "
11121112
without modifying the original"]
11131113
#[inline]
11141114
pub const fn wrapping_add(self, rhs: Self) -> Self {
1115-
#[cfg(bootstrap)] {
1116-
intrinsics::overflowing_add(self, rhs)
1117-
}
1118-
1119-
#[cfg(not(bootstrap))] {
1120-
intrinsics::wrapping_add(self, rhs)
1121-
}
1115+
intrinsics::wrapping_add(self, rhs)
11221116
}
11231117
}
11241118

@@ -1141,13 +1135,7 @@ $EndFeature, "
11411135
without modifying the original"]
11421136
#[inline]
11431137
pub const fn wrapping_sub(self, rhs: Self) -> Self {
1144-
#[cfg(bootstrap)] {
1145-
intrinsics::overflowing_sub(self, rhs)
1146-
}
1147-
1148-
#[cfg(not(bootstrap))] {
1149-
intrinsics::wrapping_sub(self, rhs)
1150-
}
1138+
intrinsics::wrapping_sub(self, rhs)
11511139
}
11521140
}
11531141

@@ -1169,13 +1157,7 @@ $EndFeature, "
11691157
without modifying the original"]
11701158
#[inline]
11711159
pub const fn wrapping_mul(self, rhs: Self) -> Self {
1172-
#[cfg(bootstrap)] {
1173-
intrinsics::overflowing_mul(self, rhs)
1174-
}
1175-
1176-
#[cfg(not(bootstrap))] {
1177-
intrinsics::wrapping_mul(self, rhs)
1178-
}
1160+
intrinsics::wrapping_mul(self, rhs)
11791161
}
11801162
}
11811163

@@ -3063,13 +3045,7 @@ $EndFeature, "
30633045
without modifying the original"]
30643046
#[inline]
30653047
pub const fn wrapping_add(self, rhs: Self) -> Self {
3066-
#[cfg(bootstrap)] {
3067-
intrinsics::overflowing_add(self, rhs)
3068-
}
3069-
3070-
#[cfg(not(bootstrap))] {
3071-
intrinsics::wrapping_add(self, rhs)
3072-
}
3048+
intrinsics::wrapping_add(self, rhs)
30733049
}
30743050
}
30753051

@@ -3091,13 +3067,7 @@ $EndFeature, "
30913067
without modifying the original"]
30923068
#[inline]
30933069
pub const fn wrapping_sub(self, rhs: Self) -> Self {
3094-
#[cfg(bootstrap)] {
3095-
intrinsics::overflowing_sub(self, rhs)
3096-
}
3097-
3098-
#[cfg(not(bootstrap))] {
3099-
intrinsics::wrapping_sub(self, rhs)
3100-
}
3070+
intrinsics::wrapping_sub(self, rhs)
31013071
}
31023072
}
31033073

@@ -3120,13 +3090,7 @@ $EndFeature, "
31203090
without modifying the original"]
31213091
#[inline]
31223092
pub const fn wrapping_mul(self, rhs: Self) -> Self {
3123-
#[cfg(bootstrap)] {
3124-
intrinsics::overflowing_mul(self, rhs)
3125-
}
3126-
3127-
#[cfg(not(bootstrap))] {
3128-
intrinsics::wrapping_mul(self, rhs)
3129-
}
3093+
intrinsics::wrapping_mul(self, rhs)
31303094
}
31313095

31323096
doc_comment! {

src/libcore/panicking.rs

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ pub fn panic_fmt(fmt: fmt::Arguments<'_>, file_line_col: &(&'static str, u32, u3
7171
}
7272

7373
// NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call
74-
#[cfg_attr(bootstrap, allow(improper_ctypes))]
7574
extern "Rust" {
7675
#[lang = "panic_impl"]
7776
fn panic_impl(pi: &PanicInfo<'_>) -> !;

src/libcore/slice/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ impl<T> [T] {
6262
/// ```
6363
#[stable(feature = "rust1", since = "1.0.0")]
6464
#[inline]
65-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_slice_len"))]
6665
// SAFETY: const sound because we transmute out the length field as a usize (which it must be)
67-
#[cfg_attr(not(bootstrap), allow_internal_unstable(const_fn_union))]
66+
#[allow_internal_unstable(const_fn_union)]
6867
pub const fn len(&self) -> usize {
6968
unsafe {
7069
crate::ptr::Repr { rust: self }.raw.len
@@ -81,7 +80,6 @@ impl<T> [T] {
8180
/// ```
8281
#[stable(feature = "rust1", since = "1.0.0")]
8382
#[inline]
84-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_slice_len"))]
8583
pub const fn is_empty(&self) -> bool {
8684
self.len() == 0
8785
}

src/libcore/str/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -2090,7 +2090,6 @@ impl str {
20902090
/// ```
20912091
#[stable(feature = "rust1", since = "1.0.0")]
20922092
#[inline]
2093-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_str_len"))]
20942093
pub const fn len(&self) -> usize {
20952094
self.as_bytes().len()
20962095
}
@@ -2110,7 +2109,6 @@ impl str {
21102109
/// ```
21112110
#[inline]
21122111
#[stable(feature = "rust1", since = "1.0.0")]
2113-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_str_len"))]
21142112
pub const fn is_empty(&self) -> bool {
21152113
self.len() == 0
21162114
}
@@ -2168,9 +2166,8 @@ impl str {
21682166
/// ```
21692167
#[stable(feature = "rust1", since = "1.0.0")]
21702168
#[inline(always)]
2171-
#[cfg_attr(bootstrap, rustc_const_unstable(feature = "const_str_as_bytes"))]
21722169
// SAFETY: const sound because we transmute two types with the same layout
2173-
#[cfg_attr(not(bootstrap), allow_internal_unstable(const_fn_union))]
2170+
#[allow_internal_unstable(const_fn_union)]
21742171
pub const fn as_bytes(&self) -> &[u8] {
21752172
#[repr(C)]
21762173
union Slices<'a> {

src/libproc_macro/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ pub mod token_stream {
227227
/// To quote `$` itself, use `$$`.
228228
#[unstable(feature = "proc_macro_quote", issue = "54722")]
229229
#[allow_internal_unstable(proc_macro_def_site)]
230-
#[cfg_attr(not(bootstrap), rustc_builtin_macro)]
230+
#[rustc_builtin_macro]
231231
pub macro quote ($($t:tt)*) { /* compiler built-in */ }
232232

233233
#[unstable(feature = "proc_macro_internals", issue = "27812")]

src/librustc/ty/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ pub struct FreeRegionInfo {
974974
///
975975
/// [rustc guide]: https://rust-lang.github.io/rustc-guide/ty.html
976976
#[derive(Copy, Clone)]
977-
#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "TyCtxt")]
977+
#[rustc_diagnostic_item = "TyCtxt"]
978978
pub struct TyCtxt<'tcx> {
979979
gcx: &'tcx GlobalCtxt<'tcx>,
980980
}

src/librustc/ty/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for ty::TyS<'tcx> {
581581
}
582582
}
583583

584-
#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "Ty")]
584+
#[rustc_diagnostic_item = "Ty"]
585585
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
586586

587587
impl<'tcx> rustc_serialize::UseSpecializedEncodable for Ty<'tcx> {}

src/librustc/ty/sty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl BoundRegion {
8686
/// AST structure in `libsyntax/ast.rs` as well.
8787
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash,
8888
RustcEncodable, RustcDecodable, HashStable, Debug)]
89-
#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "TyKind")]
89+
#[rustc_diagnostic_item = "TyKind"]
9090
pub enum TyKind<'tcx> {
9191
/// The primitive boolean type. Written as `bool`.
9292
Bool,

src/librustc_passes/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#![feature(in_band_lifetimes)]
1010
#![feature(nll)]
11-
#![cfg_attr(bootstrap, feature(bind_by_move_pattern_guards))]
1211

1312
#![recursion_limit="256"]
1413

0 commit comments

Comments
 (0)