Skip to content

Commit 84ec823

Browse files
committed
Auto merge of #72957 - Mark-Simulacrum:bootstrap-bump, r=sfackler
Bump bootstrap compiler to 1.45 Pretty standard update.
2 parents 219380d + 7139342 commit 84ec823

File tree

15 files changed

+25
-105
lines changed

15 files changed

+25
-105
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.45.0";
16+
pub const CFG_RELEASE_NUM: &str = "1.46.0";
1717

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

src/liballoc/rc.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -2035,11 +2035,7 @@ trait RcBoxPtr<T: ?Sized> {
20352035
// nevertheless, we insert an abort here to hint LLVM at
20362036
// an otherwise missed optimization.
20372037
if strong == 0 || strong == usize::max_value() {
2038-
// remove `unsafe` on bootstrap bump
2039-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
2040-
unsafe {
2041-
abort();
2042-
}
2038+
abort();
20432039
}
20442040
self.inner().strong.set(strong + 1);
20452041
}
@@ -2063,11 +2059,7 @@ trait RcBoxPtr<T: ?Sized> {
20632059
// nevertheless, we insert an abort here to hint LLVM at
20642060
// an otherwise missed optimization.
20652061
if weak == 0 || weak == usize::max_value() {
2066-
// remove `unsafe` on bootstrap bump
2067-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
2068-
unsafe {
2069-
abort();
2070-
}
2062+
abort();
20712063
}
20722064
self.inner().weak.set(weak + 1);
20732065
}

src/liballoc/sync.rs

+3-14
Original file line numberDiff line numberDiff line change
@@ -1093,11 +1093,7 @@ impl<T: ?Sized> Clone for Arc<T> {
10931093
// We abort because such a program is incredibly degenerate, and we
10941094
// don't care to support it.
10951095
if old_size > MAX_REFCOUNT {
1096-
// remove `unsafe` on bootstrap bump
1097-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
1098-
unsafe {
1099-
abort();
1100-
}
1096+
abort();
11011097
}
11021098

11031099
Self::from_inner(self.ptr)
@@ -1616,11 +1612,7 @@ impl<T: ?Sized> Weak<T> {
16161612

16171613
// See comments in `Arc::clone` for why we do this (for `mem::forget`).
16181614
if n > MAX_REFCOUNT {
1619-
// remove `unsafe` on bootstrap bump
1620-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
1621-
unsafe {
1622-
abort();
1623-
}
1615+
abort();
16241616
}
16251617

16261618
// Relaxed is valid for the same reason it is on Arc's Clone impl
@@ -1767,10 +1759,7 @@ impl<T: ?Sized> Clone for Weak<T> {
17671759

17681760
// See comments in Arc::clone() for why we do this (for mem::forget).
17691761
if old_size > MAX_REFCOUNT {
1770-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
1771-
unsafe {
1772-
abort();
1773-
}
1762+
abort();
17741763
}
17751764

17761765
Weak { ptr: self.ptr }

src/libcore/intrinsics.rs

-5
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
)]
5555
#![allow(missing_docs)]
5656

57-
#[cfg(not(bootstrap))]
5857
use crate::marker::DiscriminantKind;
5958
use crate::mem;
6059

@@ -1916,11 +1915,7 @@ extern "rust-intrinsic" {
19161915
/// The stabilized version of this intrinsic is
19171916
/// [`std::mem::discriminant`](../../std/mem/fn.discriminant.html)
19181917
#[rustc_const_unstable(feature = "const_discriminant", issue = "69821")]
1919-
#[cfg(not(bootstrap))]
19201918
pub fn discriminant_value<T>(v: &T) -> <T as DiscriminantKind>::Discriminant;
1921-
#[rustc_const_unstable(feature = "const_discriminant", issue = "69821")]
1922-
#[cfg(bootstrap)]
1923-
pub fn discriminant_value<T>(v: &T) -> u64;
19241919

19251920
/// Rust's "try catch" construct which invokes the function pointer `try_fn`
19261921
/// with the data pointer `data`.

src/libcore/marker.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -692,25 +692,13 @@ mod impls {
692692
issue = "none",
693693
reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
694694
)]
695-
#[cfg_attr(not(bootstrap), lang = "discriminant_kind")]
695+
#[lang = "discriminant_kind"]
696696
pub trait DiscriminantKind {
697697
/// The type of the dicriminant, which must satisfy the trait
698698
/// bounds required by `mem::Discriminant`.
699699
type Discriminant: Clone + Copy + Debug + Eq + PartialEq + Hash + Send + Sync + Unpin;
700700
}
701701

702-
// Manually implement `DiscriminantKind` for all types during bootstrap
703-
// to reduce the required amount of conditional compilation.
704-
#[unstable(
705-
feature = "discriminant_kind",
706-
issue = "none",
707-
reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
708-
)]
709-
#[cfg(bootstrap)]
710-
impl<T: ?Sized> DiscriminantKind for T {
711-
type Discriminant = u64;
712-
}
713-
714702
/// Compiler-internal trait used to determine whether a type contains
715703
/// any `UnsafeCell` internally, but not through an indirection.
716704
/// This affects, for example, whether a `static` of that type is

src/libcore/ops/try.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
)
2626
)]
2727
#[doc(alias = "?")]
28-
#[cfg_attr(not(bootstrap), lang = "try")]
28+
#[lang = "try"]
2929
pub trait Try {
3030
/// The type of this value when viewed as successful.
3131
#[unstable(feature = "try_trait", issue = "42327")]

src/libcore/panicking.rs

+3-18
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ use crate::panic::{Location, PanicInfo};
3939
#[lang = "panic"] // needed by codegen for panic on overflow and other `Assert` MIR terminators
4040
pub fn panic(expr: &str) -> ! {
4141
if cfg!(feature = "panic_immediate_abort") {
42-
// remove `unsafe` (and safety comment) on bootstrap bump
43-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
44-
// SAFETY: the `abort` intrinsic has no requirements to be called.
45-
unsafe {
46-
super::intrinsics::abort()
47-
}
42+
super::intrinsics::abort()
4843
}
4944

5045
// Use Arguments::new_v1 instead of format_args!("{}", expr) to potentially
@@ -62,12 +57,7 @@ pub fn panic(expr: &str) -> ! {
6257
#[lang = "panic_bounds_check"] // needed by codegen for panic on OOB array/slice access
6358
fn panic_bounds_check(index: usize, len: usize) -> ! {
6459
if cfg!(feature = "panic_immediate_abort") {
65-
// remove `unsafe` (and safety comment) on bootstrap bump
66-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
67-
// SAFETY: the `abort` intrinsic has no requirements to be called.
68-
unsafe {
69-
super::intrinsics::abort()
70-
}
60+
super::intrinsics::abort()
7161
}
7262

7363
panic!("index out of bounds: the len is {} but the index is {}", len, index)
@@ -80,12 +70,7 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
8070
#[track_caller]
8171
pub fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
8272
if cfg!(feature = "panic_immediate_abort") {
83-
// remove `unsafe` (and safety comment) on bootstrap bump
84-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
85-
// SAFETY: the `abort` intrinsic has no requirements to be called.
86-
unsafe {
87-
super::intrinsics::abort()
88-
}
73+
super::intrinsics::abort()
8974
}
9075

9176
// NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call

src/libpanic_unwind/seh.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,5 @@ pub unsafe fn cleanup(payload: *mut u8) -> Box<dyn Any + Send> {
327327
#[lang = "eh_personality"]
328328
#[cfg(not(test))]
329329
fn rust_eh_personality() {
330-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
331-
unsafe {
332-
core::intrinsics::abort()
333-
}
330+
core::intrinsics::abort()
334331
}

src/libstd/panicking.rs

+4-16
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,7 @@ pub fn panicking() -> bool {
332332
#[cfg_attr(feature = "panic_immediate_abort", inline)]
333333
pub fn begin_panic_fmt(msg: &fmt::Arguments<'_>) -> ! {
334334
if cfg!(feature = "panic_immediate_abort") {
335-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
336-
unsafe {
337-
intrinsics::abort()
338-
}
335+
intrinsics::abort()
339336
}
340337

341338
let info = PanicInfo::internal_constructor(Some(msg), Location::caller());
@@ -401,10 +398,7 @@ pub fn begin_panic_handler(info: &PanicInfo<'_>) -> ! {
401398
#[track_caller]
402399
pub fn begin_panic<M: Any + Send>(msg: M) -> ! {
403400
if cfg!(feature = "panic_immediate_abort") {
404-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
405-
unsafe {
406-
intrinsics::abort()
407-
}
401+
intrinsics::abort()
408402
}
409403

410404
rust_panic_with_hook(&mut PanicPayload::new(msg), None, Location::caller());
@@ -464,10 +458,7 @@ fn rust_panic_with_hook(
464458
"thread panicked while processing \
465459
panic. aborting.\n"
466460
));
467-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
468-
unsafe {
469-
intrinsics::abort()
470-
}
461+
intrinsics::abort()
471462
}
472463

473464
unsafe {
@@ -502,10 +493,7 @@ fn rust_panic_with_hook(
502493
"thread panicked while panicking. \
503494
aborting.\n"
504495
));
505-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
506-
unsafe {
507-
intrinsics::abort()
508-
}
496+
intrinsics::abort()
509497
}
510498

511499
rust_panic(payload)

src/libstd/sync/mpsc/shared.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,7 @@ impl<T> Packet<T> {
354354

355355
// See comments on Arc::clone() on why we do this (for `mem::forget`).
356356
if old_count > MAX_REFCOUNT {
357-
// remove `unsafe` on bootstrap bump
358-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
359-
unsafe {
360-
abort();
361-
}
357+
abort();
362358
}
363359
}
364360

src/libstd/sync/mpsc/sync.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -358,11 +358,7 @@ impl<T> Packet<T> {
358358

359359
// See comments on Arc::clone() on why we do this (for `mem::forget`).
360360
if old_count > MAX_REFCOUNT {
361-
// remove `unsafe` on bootstrap bump
362-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
363-
unsafe {
364-
abort();
365-
}
361+
abort();
366362
}
367363
}
368364

src/libstd/sys/cloudabi/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
5252
}
5353

5454
pub fn abort_internal() -> ! {
55-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
56-
unsafe {
57-
core::intrinsics::abort();
58-
}
55+
core::intrinsics::abort();
5956
}
6057

6158
pub use libc::strlen;

src/libstd/sys/windows/mod.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,5 @@ pub fn abort_internal() -> ! {
314314
llvm_asm!("int $$0x29" :: "{ecx}"(7) ::: volatile); // 7 is FAST_FAIL_FATAL_APP_EXIT
315315
crate::intrinsics::unreachable();
316316
}
317-
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
318-
unsafe {
319-
crate::intrinsics::abort();
320-
}
317+
crate::intrinsics::abort();
321318
}

src/stage0.txt

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

15-
date: 2020-04-22
15+
date: 2020-06-03
1616
rustc: beta
1717
cargo: beta
1818

src/tools/clippy/clippy_lints/src/write.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,13 @@ impl EarlyLintPass for Write {
279279
if let (Some(fmt_str), expr) = self.check_tts(cx, &mac.args.inner_tokens(), true) {
280280
if fmt_str.symbol == Symbol::intern("") {
281281
let mut applicability = Applicability::MachineApplicable;
282-
let suggestion = expr.map_or_else(
283-
move || {
282+
let suggestion = match expr {
283+
Some(expr) => snippet_with_applicability(cx, expr.span, "v", &mut applicability),
284+
None => {
284285
applicability = Applicability::HasPlaceholders;
285286
Cow::Borrowed("v")
286287
},
287-
move |expr| snippet_with_applicability(cx, expr.span, "v", &mut applicability),
288-
);
288+
};
289289

290290
span_lint_and_sugg(
291291
cx,

0 commit comments

Comments
 (0)