Bump to 1.46
This commit is contained in:
parent
6f48888456
commit
7139342249
|
@ -13,7 +13,7 @@ use build_helper::output;
|
||||||
use crate::Build;
|
use crate::Build;
|
||||||
|
|
||||||
// The version number
|
// The version number
|
||||||
pub const CFG_RELEASE_NUM: &str = "1.45.0";
|
pub const CFG_RELEASE_NUM: &str = "1.46.0";
|
||||||
|
|
||||||
pub struct GitInfo {
|
pub struct GitInfo {
|
||||||
inner: Option<Info>,
|
inner: Option<Info>,
|
||||||
|
|
|
@ -2035,11 +2035,7 @@ trait RcBoxPtr<T: ?Sized> {
|
||||||
// nevertheless, we insert an abort here to hint LLVM at
|
// nevertheless, we insert an abort here to hint LLVM at
|
||||||
// an otherwise missed optimization.
|
// an otherwise missed optimization.
|
||||||
if strong == 0 || strong == usize::max_value() {
|
if strong == 0 || strong == usize::max_value() {
|
||||||
// remove `unsafe` on bootstrap bump
|
abort();
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
|
|
||||||
unsafe {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
self.inner().strong.set(strong + 1);
|
self.inner().strong.set(strong + 1);
|
||||||
}
|
}
|
||||||
|
@ -2063,11 +2059,7 @@ trait RcBoxPtr<T: ?Sized> {
|
||||||
// nevertheless, we insert an abort here to hint LLVM at
|
// nevertheless, we insert an abort here to hint LLVM at
|
||||||
// an otherwise missed optimization.
|
// an otherwise missed optimization.
|
||||||
if weak == 0 || weak == usize::max_value() {
|
if weak == 0 || weak == usize::max_value() {
|
||||||
// remove `unsafe` on bootstrap bump
|
abort();
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
|
|
||||||
unsafe {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
self.inner().weak.set(weak + 1);
|
self.inner().weak.set(weak + 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1093,11 +1093,7 @@ impl<T: ?Sized> Clone for Arc<T> {
|
||||||
// We abort because such a program is incredibly degenerate, and we
|
// We abort because such a program is incredibly degenerate, and we
|
||||||
// don't care to support it.
|
// don't care to support it.
|
||||||
if old_size > MAX_REFCOUNT {
|
if old_size > MAX_REFCOUNT {
|
||||||
// remove `unsafe` on bootstrap bump
|
abort();
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
|
|
||||||
unsafe {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Self::from_inner(self.ptr)
|
Self::from_inner(self.ptr)
|
||||||
|
@ -1616,11 +1612,7 @@ impl<T: ?Sized> Weak<T> {
|
||||||
|
|
||||||
// See comments in `Arc::clone` for why we do this (for `mem::forget`).
|
// See comments in `Arc::clone` for why we do this (for `mem::forget`).
|
||||||
if n > MAX_REFCOUNT {
|
if n > MAX_REFCOUNT {
|
||||||
// remove `unsafe` on bootstrap bump
|
abort();
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
|
|
||||||
unsafe {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Relaxed is valid for the same reason it is on Arc's Clone impl
|
// 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> {
|
||||||
|
|
||||||
// See comments in Arc::clone() for why we do this (for mem::forget).
|
// See comments in Arc::clone() for why we do this (for mem::forget).
|
||||||
if old_size > MAX_REFCOUNT {
|
if old_size > MAX_REFCOUNT {
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
|
abort();
|
||||||
unsafe {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Weak { ptr: self.ptr }
|
Weak { ptr: self.ptr }
|
||||||
|
|
|
@ -54,7 +54,6 @@
|
||||||
)]
|
)]
|
||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
#[cfg(not(bootstrap))]
|
|
||||||
use crate::marker::DiscriminantKind;
|
use crate::marker::DiscriminantKind;
|
||||||
use crate::mem;
|
use crate::mem;
|
||||||
|
|
||||||
|
@ -1916,11 +1915,7 @@ extern "rust-intrinsic" {
|
||||||
/// The stabilized version of this intrinsic is
|
/// The stabilized version of this intrinsic is
|
||||||
/// [`std::mem::discriminant`](../../std/mem/fn.discriminant.html)
|
/// [`std::mem::discriminant`](../../std/mem/fn.discriminant.html)
|
||||||
#[rustc_const_unstable(feature = "const_discriminant", issue = "69821")]
|
#[rustc_const_unstable(feature = "const_discriminant", issue = "69821")]
|
||||||
#[cfg(not(bootstrap))]
|
|
||||||
pub fn discriminant_value<T>(v: &T) -> <T as DiscriminantKind>::Discriminant;
|
pub fn discriminant_value<T>(v: &T) -> <T as DiscriminantKind>::Discriminant;
|
||||||
#[rustc_const_unstable(feature = "const_discriminant", issue = "69821")]
|
|
||||||
#[cfg(bootstrap)]
|
|
||||||
pub fn discriminant_value<T>(v: &T) -> u64;
|
|
||||||
|
|
||||||
/// Rust's "try catch" construct which invokes the function pointer `try_fn`
|
/// Rust's "try catch" construct which invokes the function pointer `try_fn`
|
||||||
/// with the data pointer `data`.
|
/// with the data pointer `data`.
|
||||||
|
|
|
@ -692,25 +692,13 @@ mod impls {
|
||||||
issue = "none",
|
issue = "none",
|
||||||
reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
|
reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
|
||||||
)]
|
)]
|
||||||
#[cfg_attr(not(bootstrap), lang = "discriminant_kind")]
|
#[lang = "discriminant_kind"]
|
||||||
pub trait DiscriminantKind {
|
pub trait DiscriminantKind {
|
||||||
/// The type of the dicriminant, which must satisfy the trait
|
/// The type of the dicriminant, which must satisfy the trait
|
||||||
/// bounds required by `mem::Discriminant`.
|
/// bounds required by `mem::Discriminant`.
|
||||||
type Discriminant: Clone + Copy + Debug + Eq + PartialEq + Hash + Send + Sync + Unpin;
|
type Discriminant: Clone + Copy + Debug + Eq + PartialEq + Hash + Send + Sync + Unpin;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Manually implement `DiscriminantKind` for all types during bootstrap
|
|
||||||
// to reduce the required amount of conditional compilation.
|
|
||||||
#[unstable(
|
|
||||||
feature = "discriminant_kind",
|
|
||||||
issue = "none",
|
|
||||||
reason = "this trait is unlikely to ever be stabilized, use `mem::discriminant` instead"
|
|
||||||
)]
|
|
||||||
#[cfg(bootstrap)]
|
|
||||||
impl<T: ?Sized> DiscriminantKind for T {
|
|
||||||
type Discriminant = u64;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Compiler-internal trait used to determine whether a type contains
|
/// Compiler-internal trait used to determine whether a type contains
|
||||||
/// any `UnsafeCell` internally, but not through an indirection.
|
/// any `UnsafeCell` internally, but not through an indirection.
|
||||||
/// This affects, for example, whether a `static` of that type is
|
/// This affects, for example, whether a `static` of that type is
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
#[doc(alias = "?")]
|
#[doc(alias = "?")]
|
||||||
#[cfg_attr(not(bootstrap), lang = "try")]
|
#[lang = "try"]
|
||||||
pub trait Try {
|
pub trait Try {
|
||||||
/// The type of this value when viewed as successful.
|
/// The type of this value when viewed as successful.
|
||||||
#[unstable(feature = "try_trait", issue = "42327")]
|
#[unstable(feature = "try_trait", issue = "42327")]
|
||||||
|
|
|
@ -39,12 +39,7 @@ use crate::panic::{Location, PanicInfo};
|
||||||
#[lang = "panic"] // needed by codegen for panic on overflow and other `Assert` MIR terminators
|
#[lang = "panic"] // needed by codegen for panic on overflow and other `Assert` MIR terminators
|
||||||
pub fn panic(expr: &str) -> ! {
|
pub fn panic(expr: &str) -> ! {
|
||||||
if cfg!(feature = "panic_immediate_abort") {
|
if cfg!(feature = "panic_immediate_abort") {
|
||||||
// remove `unsafe` (and safety comment) on bootstrap bump
|
super::intrinsics::abort()
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
|
|
||||||
// SAFETY: the `abort` intrinsic has no requirements to be called.
|
|
||||||
unsafe {
|
|
||||||
super::intrinsics::abort()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use Arguments::new_v1 instead of format_args!("{}", expr) to potentially
|
// Use Arguments::new_v1 instead of format_args!("{}", expr) to potentially
|
||||||
|
@ -62,12 +57,7 @@ pub fn panic(expr: &str) -> ! {
|
||||||
#[lang = "panic_bounds_check"] // needed by codegen for panic on OOB array/slice access
|
#[lang = "panic_bounds_check"] // needed by codegen for panic on OOB array/slice access
|
||||||
fn panic_bounds_check(index: usize, len: usize) -> ! {
|
fn panic_bounds_check(index: usize, len: usize) -> ! {
|
||||||
if cfg!(feature = "panic_immediate_abort") {
|
if cfg!(feature = "panic_immediate_abort") {
|
||||||
// remove `unsafe` (and safety comment) on bootstrap bump
|
super::intrinsics::abort()
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
|
|
||||||
// SAFETY: the `abort` intrinsic has no requirements to be called.
|
|
||||||
unsafe {
|
|
||||||
super::intrinsics::abort()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
panic!("index out of bounds: the len is {} but the index is {}", len, index)
|
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) -> ! {
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
|
pub fn panic_fmt(fmt: fmt::Arguments<'_>) -> ! {
|
||||||
if cfg!(feature = "panic_immediate_abort") {
|
if cfg!(feature = "panic_immediate_abort") {
|
||||||
// remove `unsafe` (and safety comment) on bootstrap bump
|
super::intrinsics::abort()
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
|
|
||||||
// SAFETY: the `abort` intrinsic has no requirements to be called.
|
|
||||||
unsafe {
|
|
||||||
super::intrinsics::abort()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call
|
// NOTE This function never crosses the FFI boundary; it's a Rust-to-Rust call
|
||||||
|
|
|
@ -327,8 +327,5 @@ pub unsafe fn cleanup(payload: *mut u8) -> Box<dyn Any + Send> {
|
||||||
#[lang = "eh_personality"]
|
#[lang = "eh_personality"]
|
||||||
#[cfg(not(test))]
|
#[cfg(not(test))]
|
||||||
fn rust_eh_personality() {
|
fn rust_eh_personality() {
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
|
core::intrinsics::abort()
|
||||||
unsafe {
|
|
||||||
core::intrinsics::abort()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -332,10 +332,7 @@ pub fn panicking() -> bool {
|
||||||
#[cfg_attr(feature = "panic_immediate_abort", inline)]
|
#[cfg_attr(feature = "panic_immediate_abort", inline)]
|
||||||
pub fn begin_panic_fmt(msg: &fmt::Arguments<'_>) -> ! {
|
pub fn begin_panic_fmt(msg: &fmt::Arguments<'_>) -> ! {
|
||||||
if cfg!(feature = "panic_immediate_abort") {
|
if cfg!(feature = "panic_immediate_abort") {
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
|
intrinsics::abort()
|
||||||
unsafe {
|
|
||||||
intrinsics::abort()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let info = PanicInfo::internal_constructor(Some(msg), Location::caller());
|
let info = PanicInfo::internal_constructor(Some(msg), Location::caller());
|
||||||
|
@ -401,10 +398,7 @@ pub fn begin_panic_handler(info: &PanicInfo<'_>) -> ! {
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn begin_panic<M: Any + Send>(msg: M) -> ! {
|
pub fn begin_panic<M: Any + Send>(msg: M) -> ! {
|
||||||
if cfg!(feature = "panic_immediate_abort") {
|
if cfg!(feature = "panic_immediate_abort") {
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
|
intrinsics::abort()
|
||||||
unsafe {
|
|
||||||
intrinsics::abort()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rust_panic_with_hook(&mut PanicPayload::new(msg), None, Location::caller());
|
rust_panic_with_hook(&mut PanicPayload::new(msg), None, Location::caller());
|
||||||
|
@ -464,10 +458,7 @@ fn rust_panic_with_hook(
|
||||||
"thread panicked while processing \
|
"thread panicked while processing \
|
||||||
panic. aborting.\n"
|
panic. aborting.\n"
|
||||||
));
|
));
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
|
intrinsics::abort()
|
||||||
unsafe {
|
|
||||||
intrinsics::abort()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
@ -502,10 +493,7 @@ fn rust_panic_with_hook(
|
||||||
"thread panicked while panicking. \
|
"thread panicked while panicking. \
|
||||||
aborting.\n"
|
aborting.\n"
|
||||||
));
|
));
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
|
intrinsics::abort()
|
||||||
unsafe {
|
|
||||||
intrinsics::abort()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rust_panic(payload)
|
rust_panic(payload)
|
||||||
|
|
|
@ -354,11 +354,7 @@ impl<T> Packet<T> {
|
||||||
|
|
||||||
// See comments on Arc::clone() on why we do this (for `mem::forget`).
|
// See comments on Arc::clone() on why we do this (for `mem::forget`).
|
||||||
if old_count > MAX_REFCOUNT {
|
if old_count > MAX_REFCOUNT {
|
||||||
// remove `unsafe` on bootstrap bump
|
abort();
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
|
|
||||||
unsafe {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -358,11 +358,7 @@ impl<T> Packet<T> {
|
||||||
|
|
||||||
// See comments on Arc::clone() on why we do this (for `mem::forget`).
|
// See comments on Arc::clone() on why we do this (for `mem::forget`).
|
||||||
if old_count > MAX_REFCOUNT {
|
if old_count > MAX_REFCOUNT {
|
||||||
// remove `unsafe` on bootstrap bump
|
abort();
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))]
|
|
||||||
unsafe {
|
|
||||||
abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,10 +52,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn abort_internal() -> ! {
|
pub fn abort_internal() -> ! {
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
|
core::intrinsics::abort();
|
||||||
unsafe {
|
|
||||||
core::intrinsics::abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use libc::strlen;
|
pub use libc::strlen;
|
||||||
|
|
|
@ -314,8 +314,5 @@ pub fn abort_internal() -> ! {
|
||||||
llvm_asm!("int $$0x29" :: "{ecx}"(7) ::: volatile); // 7 is FAST_FAIL_FATAL_APP_EXIT
|
llvm_asm!("int $$0x29" :: "{ecx}"(7) ::: volatile); // 7 is FAST_FAIL_FATAL_APP_EXIT
|
||||||
crate::intrinsics::unreachable();
|
crate::intrinsics::unreachable();
|
||||||
}
|
}
|
||||||
#[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump
|
crate::intrinsics::abort();
|
||||||
unsafe {
|
|
||||||
crate::intrinsics::abort();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
|
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
|
||||||
# `0.(x+1).0` for Cargo where they were released on `date`.
|
# `0.(x+1).0` for Cargo where they were released on `date`.
|
||||||
|
|
||||||
date: 2020-04-22
|
date: 2020-06-03
|
||||||
rustc: beta
|
rustc: beta
|
||||||
cargo: beta
|
cargo: beta
|
||||||
|
|
||||||
|
|
|
@ -279,13 +279,13 @@ impl EarlyLintPass for Write {
|
||||||
if let (Some(fmt_str), expr) = self.check_tts(cx, &mac.args.inner_tokens(), true) {
|
if let (Some(fmt_str), expr) = self.check_tts(cx, &mac.args.inner_tokens(), true) {
|
||||||
if fmt_str.symbol == Symbol::intern("") {
|
if fmt_str.symbol == Symbol::intern("") {
|
||||||
let mut applicability = Applicability::MachineApplicable;
|
let mut applicability = Applicability::MachineApplicable;
|
||||||
let suggestion = expr.map_or_else(
|
let suggestion = match expr {
|
||||||
move || {
|
Some(expr) => snippet_with_applicability(cx, expr.span, "v", &mut applicability),
|
||||||
|
None => {
|
||||||
applicability = Applicability::HasPlaceholders;
|
applicability = Applicability::HasPlaceholders;
|
||||||
Cow::Borrowed("v")
|
Cow::Borrowed("v")
|
||||||
},
|
},
|
||||||
move |expr| snippet_with_applicability(cx, expr.span, "v", &mut applicability),
|
};
|
||||||
);
|
|
||||||
|
|
||||||
span_lint_and_sugg(
|
span_lint_and_sugg(
|
||||||
cx,
|
cx,
|
||||||
|
|
Loading…
Reference in New Issue