Auto merge of #131696 - cuviper:beta-1.83.0, r=cuviper

[beta] Prepare Rust 1.83.0

r? ghost
This commit is contained in:
bors
2024-10-14 22:27:23 +00:00
33 changed files with 182 additions and 186 deletions
+5 -5
View File
@@ -116,7 +116,7 @@ macro_rules! declare_features {
/// Allows calling constructor functions in `const fn`.
(accepted, const_constructor, "1.40.0", Some(61456)),
/// Allows the definition of `const extern fn` and `const unsafe extern fn`.
(accepted, const_extern_fn, "CURRENT_RUSTC_VERSION", Some(64926)),
(accepted, const_extern_fn, "1.83.0", Some(64926)),
/// Allows basic arithmetic on floating point types in a `const fn`.
(accepted, const_fn_floating_point_arithmetic, "1.82.0", Some(57241)),
/// Allows using and casting function pointers in a `const fn`.
@@ -144,15 +144,15 @@ macro_rules! declare_features {
/// Allows the use of `loop` and `while` in constants.
(accepted, const_loop, "1.46.0", Some(52000)),
/// Allows using `&mut` in constant functions.
(accepted, const_mut_refs, "CURRENT_RUSTC_VERSION", Some(57349)),
(accepted, const_mut_refs, "1.83.0", Some(57349)),
/// Allows panicking during const eval (producing compile-time errors).
(accepted, const_panic, "1.57.0", Some(51999)),
/// Allows dereferencing raw pointers during const eval.
(accepted, const_raw_ptr_deref, "1.58.0", Some(51911)),
/// Allows references to types with interior mutability within constants
(accepted, const_refs_to_cell, "CURRENT_RUSTC_VERSION", Some(80384)),
(accepted, const_refs_to_cell, "1.83.0", Some(80384)),
/// Allows creating pointers and references to `static` items in constants.
(accepted, const_refs_to_static, "CURRENT_RUSTC_VERSION", Some(119618)),
(accepted, const_refs_to_static, "1.83.0", Some(119618)),
/// Allows implementing `Copy` for closures where possible (RFC 2132).
(accepted, copy_closures, "1.26.0", Some(44490)),
/// Allows `crate` in paths.
@@ -190,7 +190,7 @@ macro_rules! declare_features {
/// Allows explicit generic arguments specification with `impl Trait` present.
(accepted, explicit_generic_args_with_impl_trait, "1.63.0", Some(83701)),
/// Uses 2024 rules for matching `expr` fragments in macros. Also enables `expr_2021` fragment.
(accepted, expr_fragment_specifier_2024, "CURRENT_RUSTC_VERSION", Some(123742)),
(accepted, expr_fragment_specifier_2024, "1.83.0", Some(123742)),
/// Allows arbitrary expressions in key-value attributes at parse time.
(accepted, extended_key_value_attributes, "1.54.0", Some(78835)),
/// Allows resolving absolute paths as paths from other crates.
+2 -2
View File
@@ -156,7 +156,7 @@ macro_rules! declare_features {
(removed, no_stack_check, "1.0.0", None, None),
/// Allows making `dyn Trait` well-formed even if `Trait` is not dyn-compatible (object safe).
/// Renamed to `dyn_compatible_for_dispatch`.
(removed, object_safe_for_dispatch, "CURRENT_RUSTC_VERSION", Some(43561),
(removed, object_safe_for_dispatch, "1.83.0", Some(43561),
Some("renamed to `dyn_compatible_for_dispatch`")),
/// Allows using `#[on_unimplemented(..)]` on traits.
/// (Moved to `rustc_attrs`.)
@@ -221,7 +221,7 @@ macro_rules! declare_features {
/// Allows using items which are missing stability attributes
(removed, unmarked_api, "1.0.0", None, None),
/// Allows unnamed fields of struct and union type
(removed, unnamed_fields, "CURRENT_RUSTC_VERSION", Some(49804), Some("feature needs redesign")),
(removed, unnamed_fields, "1.83.0", Some(49804), Some("feature needs redesign")),
(removed, unsafe_no_drop_flag, "1.0.0", None, None),
/// Allows `union` fields that don't implement `Copy` as long as they don't have any drop glue.
(removed, untagged_unions, "1.13.0", Some(55149),
+7 -7
View File
@@ -228,7 +228,7 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Added for testing unstable lints; perma-unstable.
(internal, test_unstable_lint, "1.60.0", None),
/// Helps with formatting for `group_imports = "StdExternalCrate"`.
(unstable, unqualified_local_imports, "CURRENT_RUSTC_VERSION", None),
(unstable, unqualified_local_imports, "1.83.0", None),
/// Use for stable + negative coherence and strict coherence depending on trait's
/// rustc_strict_coherence value.
(unstable, with_negative_coherence, "1.60.0", None),
@@ -266,7 +266,7 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Renamed from `object_safe_for_dispatch`.
///
/// [^1]: Formerly known as "object safe".
(unstable, dyn_compatible_for_dispatch, "CURRENT_RUSTC_VERSION", Some(43561)),
(unstable, dyn_compatible_for_dispatch, "1.83.0", Some(43561)),
/// Allows using the `#[fundamental]` attribute.
(unstable, fundamental, "1.0.0", Some(29635)),
/// Allows using `#[link_name="llvm.*"]`.
@@ -360,7 +360,7 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Allows inherent and trait methods with arbitrary self types.
(unstable, arbitrary_self_types, "1.23.0", Some(44874)),
/// Allows inherent and trait methods with arbitrary self types that are raw pointers.
(unstable, arbitrary_self_types_pointers, "CURRENT_RUSTC_VERSION", Some(44874)),
(unstable, arbitrary_self_types_pointers, "1.83.0", Some(44874)),
/// Enables experimental inline assembly support for additional architectures.
(unstable, asm_experimental_arch, "1.58.0", Some(93335)),
/// Allows using `label` operands in inline assembly.
@@ -380,7 +380,7 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Allows using C-variadics.
(unstable, c_variadic, "1.34.0", Some(44930)),
/// Allows the use of `#[cfg(<true/false>)]`.
(unstable, cfg_boolean_literals, "CURRENT_RUSTC_VERSION", Some(131204)),
(unstable, cfg_boolean_literals, "1.83.0", Some(131204)),
/// Allows the use of `#[cfg(overflow_checks)` to check if integer overflow behaviour.
(unstable, cfg_overflow_checks, "1.71.0", Some(111466)),
/// Provides the relocation model information as cfg entry
@@ -498,7 +498,7 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Allows `if let` guard in match arms.
(unstable, if_let_guard, "1.47.0", Some(51114)),
/// Rescoping temporaries in `if let` to align with Rust 2024.
(unstable, if_let_rescope, "CURRENT_RUSTC_VERSION", Some(124085)),
(unstable, if_let_rescope, "1.83.0", Some(124085)),
/// Allows `impl Trait` to be used inside associated types (RFC 2515).
(unstable, impl_trait_in_assoc_type, "1.70.0", Some(63063)),
/// Allows `impl Trait` as output type in `Fn` traits in return position of functions.
@@ -563,11 +563,11 @@ pub fn internal(&self, feature: Symbol) -> bool {
/// Allows specifying nop padding on functions for dynamic patching.
(unstable, patchable_function_entry, "1.81.0", Some(123115)),
/// Experimental features that make `Pin` more ergonomic.
(incomplete, pin_ergonomics, "CURRENT_RUSTC_VERSION", Some(130494)),
(incomplete, pin_ergonomics, "1.83.0", Some(130494)),
/// Allows postfix match `expr.match { ... }`
(unstable, postfix_match, "1.79.0", Some(121618)),
/// Allows `use<..>` precise capturign on impl Trait in traits.
(unstable, precise_capturing_in_traits, "CURRENT_RUSTC_VERSION", Some(130044)),
(unstable, precise_capturing_in_traits, "1.83.0", Some(130044)),
/// Allows macro attributes on expressions, statements and non-inline modules.
(unstable, proc_macro_hygiene, "1.30.0", Some(54727)),
/// Makes `&` and `&mut` patterns eat only one layer of references in Rust 2024.
+1 -1
View File
@@ -146,7 +146,7 @@
/// Converts a mutable reference to `T` into a mutable reference to an array of length 1 (without copying).
#[stable(feature = "array_from_ref", since = "1.53.0")]
#[rustc_const_stable(feature = "const_array_from_ref", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_array_from_ref", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn from_mut<T>(s: &mut T) -> &mut [T; 1] {
// SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
+4 -4
View File
@@ -515,7 +515,7 @@ pub const fn replace(&self, val: T) -> T {
/// assert_eq!(five, 5);
/// ```
#[stable(feature = "move_cell", since = "1.17.0")]
#[rustc_const_stable(feature = "const_cell_into_inner", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_cell_into_inner", since = "1.83.0")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
pub const fn into_inner(self) -> T {
self.value.into_inner()
@@ -864,7 +864,7 @@ pub const fn new(value: T) -> RefCell<T> {
/// let five = c.into_inner();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_cell_into_inner", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_cell_into_inner", since = "1.83.0")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
#[inline]
pub const fn into_inner(self) -> T {
@@ -2108,7 +2108,7 @@ pub const fn new(value: T) -> UnsafeCell<T> {
/// ```
#[inline(always)]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_cell_into_inner", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_cell_into_inner", since = "1.83.0")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
pub const fn into_inner(self) -> T {
self.value
@@ -2182,7 +2182,7 @@ pub const fn get(&self) -> *mut T {
#[inline(always)]
#[stable(feature = "unsafe_cell_get_mut", since = "1.50.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_unsafecell_get_mut", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_unsafecell_get_mut", since = "1.83.0")]
pub const fn get_mut(&mut self) -> &mut T {
&mut self.value
}
+1 -1
View File
@@ -309,7 +309,7 @@ fn try_init<F, E>(&self, f: F) -> Result<&T, E>
/// ```
#[inline]
#[stable(feature = "once_cell", since = "1.70.0")]
#[rustc_const_stable(feature = "const_cell_into_inner", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_cell_into_inner", since = "1.83.0")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
pub const fn into_inner(self) -> Option<T> {
// Because `into_inner` takes `self` by value, the compiler statically verifies
+3 -3
View File
@@ -36,7 +36,7 @@ impl char {
/// let value_at_min = u32::from(char::MIN);
/// assert_eq!(char::from_u32(value_at_min), Some('\0'));
/// ```
#[stable(feature = "char_min", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "char_min", since = "1.83.0")]
pub const MIN: char = '\0';
/// The highest valid code point a `char` can have, `'\u{10FFFF}'`.
@@ -674,7 +674,7 @@ pub const fn len_utf16(self) -> usize {
/// 'ß'.encode_utf8(&mut b);
/// ```
#[stable(feature = "unicode_encode_char", since = "1.15.0")]
#[rustc_const_stable(feature = "const_char_encode_utf8", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_char_encode_utf8", since = "1.83.0")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn encode_utf8(self, dst: &mut [u8]) -> &mut str {
@@ -1771,7 +1771,7 @@ const fn len_utf16(code: u32) -> usize {
/// Panics if the buffer is not large enough.
/// A buffer of length four is large enough to encode any `char`.
#[unstable(feature = "char_internals", reason = "exposed only for libstd", issue = "none")]
#[rustc_const_stable(feature = "const_char_encode_utf8", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_char_encode_utf8", since = "1.83.0")]
#[doc(hidden)]
#[inline]
#[rustc_allow_const_fn_unstable(const_eval_select)]
+4 -4
View File
@@ -383,7 +383,7 @@ pub fn field_with<F>(&mut self, value_fmt: F) -> &mut Self
/// "Foo(10, ..)",
/// );
/// ```
#[stable(feature = "debug_more_non_exhaustive", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "debug_more_non_exhaustive", since = "1.83.0")]
pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
self.result = self.result.and_then(|_| {
if self.fields > 0 {
@@ -626,7 +626,7 @@ pub fn entries<D, I>(&mut self, entries: I) -> &mut Self
/// "{1, 2, ..}",
/// );
/// ```
#[stable(feature = "debug_more_non_exhaustive", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "debug_more_non_exhaustive", since = "1.83.0")]
pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
self.inner.result = self.inner.result.and_then(|_| {
if self.inner.has_fields {
@@ -818,7 +818,7 @@ pub fn entries<D, I>(&mut self, entries: I) -> &mut Self
/// "[1, 2, ..]",
/// );
/// ```
#[stable(feature = "debug_more_non_exhaustive", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "debug_more_non_exhaustive", since = "1.83.0")]
pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
self.inner.result.and_then(|_| {
if self.inner.has_fields {
@@ -1146,7 +1146,7 @@ pub fn entries<K, V, I>(&mut self, entries: I) -> &mut Self
/// r#"{"A": 10, "B": 11, ..}"#,
/// );
/// ```
#[stable(feature = "debug_more_non_exhaustive", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "debug_more_non_exhaustive", since = "1.83.0")]
pub fn finish_non_exhaustive(&mut self) -> fmt::Result {
self.result = self.result.and_then(|_| {
assert!(!self.has_key, "attempted to finish a map with a partial entry");
+10 -10
View File
@@ -1084,7 +1084,7 @@ pub fn select_unpredictable<T>(b: bool, true_val: T, false_val: T) -> T {
/// it does not require an `unsafe` block.
/// Therefore, implementations must not require the user to uphold
/// any safety invariants.
#[rustc_const_stable(feature = "const_intrinsic_forget", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_forget", since = "1.83.0")]
#[rustc_safe_intrinsic]
#[rustc_nounwind]
pub fn forget<T: ?Sized>(_: T);
@@ -2688,7 +2688,7 @@ pub fn select_unpredictable<T>(b: bool, true_val: T, false_val: T) -> T {
/// This intrinsic can *only* be called where the pointer is a local without
/// projections (`write_via_move(ptr, x)`, not `write_via_move(*ptr, x)`) so
/// that it trivially obeys runtime-MIR rules about derefs in operands.
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
#[rustc_nounwind]
pub fn write_via_move<T>(ptr: *mut T, value: T);
@@ -3217,7 +3217,7 @@ pub const fn type_id<T: ?Sized + 'static>() -> u128 {
/// change the possible layouts of pointers.
#[rustc_nounwind]
#[unstable(feature = "core_intrinsics", issue = "none")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "1.83.0")]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub const fn aggregate_raw_ptr<P: AggregateRawPtr<D, Metadata = M>, D, M>(_data: D, _meta: M) -> P {
@@ -3242,7 +3242,7 @@ impl<P: ?Sized, T: ptr::Thin> AggregateRawPtr<*mut T> for *mut P {
/// This is used to implement functions like `ptr::metadata`.
#[rustc_nounwind]
#[unstable(feature = "core_intrinsics", issue = "none")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "1.83.0")]
#[rustc_intrinsic]
#[rustc_intrinsic_must_be_overridden]
pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(_ptr: *const P) -> M {
@@ -3343,13 +3343,13 @@ pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(_ptr: *cons
#[doc(alias = "memcpy")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_allowed_through_unstable_modules]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[rustc_diagnostic_item = "ptr_copy_nonoverlapping"]
pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
extern "rust-intrinsic" {
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[rustc_nounwind]
pub fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
}
@@ -3445,13 +3445,13 @@ pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(_ptr: *cons
#[doc(alias = "memmove")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_allowed_through_unstable_modules]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[rustc_diagnostic_item = "ptr_copy"]
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
extern "rust-intrinsic" {
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[rustc_nounwind]
fn copy<T>(src: *const T, dst: *mut T, count: usize);
}
@@ -3525,13 +3525,13 @@ pub const fn ptr_metadata<P: ptr::Pointee<Metadata = M> + ?Sized, M>(_ptr: *cons
#[doc(alias = "memset")]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_allowed_through_unstable_modules]
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[rustc_diagnostic_item = "ptr_write_bytes"]
pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
extern "rust-intrinsic" {
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
#[rustc_nounwind]
fn write_bytes<T>(dst: *mut T, val: u8, count: usize);
}
+1 -4
View File
@@ -569,10 +569,7 @@ pub const fn as_ptr(&self) -> *const T {
/// (Notice that the rules around references to uninitialized data are not finalized yet, but
/// until they are, it is advisable to avoid them.)
#[stable(feature = "maybe_uninit", since = "1.36.0")]
#[rustc_const_stable(
feature = "const_maybe_uninit_as_mut_ptr",
since = "CURRENT_RUSTC_VERSION"
)]
#[rustc_const_stable(feature = "const_maybe_uninit_as_mut_ptr", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[inline(always)]
pub const fn as_mut_ptr(&mut self) -> *mut T {
+1 -1
View File
@@ -858,7 +858,7 @@ pub fn take<T: Default>(dest: &mut T) -> T {
#[stable(feature = "rust1", since = "1.0.0")]
#[must_use = "if you don't need the old value, you can just assign the new value directly"]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_replace", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_replace", since = "1.83.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "mem_replace")]
pub const fn replace<T>(dest: &mut T, src: T) -> T {
// It may be tempting to use `swap` to avoid `unsafe` here. Don't!
+16 -16
View File
@@ -517,7 +517,7 @@ impl f32 {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
#[allow(clippy::eq_op)] // > if you intended to check if the operand is NaN, use `.is_nan()` instead :)
pub const fn is_nan(self) -> bool {
@@ -550,7 +550,7 @@ pub(crate) const fn abs_private(self) -> f32 {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_infinite(self) -> bool {
// Getting clever with transmutation can result in incorrect answers on some FPUs
@@ -575,7 +575,7 @@ pub const fn is_infinite(self) -> bool {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_finite(self) -> bool {
// There's no need to handle NaN separately: if self is NaN,
@@ -603,7 +603,7 @@ pub const fn is_finite(self) -> bool {
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[must_use]
#[stable(feature = "is_subnormal", since = "1.53.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_subnormal(self) -> bool {
matches!(self.classify(), FpCategory::Subnormal)
@@ -630,7 +630,7 @@ pub const fn is_subnormal(self) -> bool {
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_normal(self) -> bool {
matches!(self.classify(), FpCategory::Normal)
@@ -650,7 +650,7 @@ pub const fn is_normal(self) -> bool {
/// assert_eq!(inf.classify(), FpCategory::Infinite);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
pub const fn classify(self) -> FpCategory {
// We used to have complicated logic here that avoids the simple bit-based tests to work
// around buggy codegen for x87 targets (see
@@ -686,7 +686,7 @@ pub const fn classify(self) -> FpCategory {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_sign_positive(self) -> bool {
!self.is_sign_negative()
@@ -711,7 +711,7 @@ pub const fn is_sign_positive(self) -> bool {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_sign_negative(self) -> bool {
// IEEE754 says: isSignMinus(x) is true if and only if x has negative sign. isSignMinus
@@ -1088,7 +1088,7 @@ pub unsafe fn to_int_unchecked<Int>(self) -> Int
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[inline]
pub const fn to_bits(self) -> u32 {
// SAFETY: `u32` is a plain old datatype so we can always transmute to it.
@@ -1132,7 +1132,7 @@ pub const fn to_bits(self) -> u32 {
/// assert_eq!(v, 12.5);
/// ```
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[must_use]
#[inline]
pub const fn from_bits(v: u32) -> Self {
@@ -1156,7 +1156,7 @@ pub const fn from_bits(v: u32) -> Self {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[inline]
pub const fn to_be_bytes(self) -> [u8; 4] {
self.to_bits().to_be_bytes()
@@ -1177,7 +1177,7 @@ pub const fn from_bits(v: u32) -> Self {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[inline]
pub const fn to_le_bytes(self) -> [u8; 4] {
self.to_bits().to_le_bytes()
@@ -1211,7 +1211,7 @@ pub const fn from_bits(v: u32) -> Self {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[inline]
pub const fn to_ne_bytes(self) -> [u8; 4] {
self.to_bits().to_ne_bytes()
@@ -1229,7 +1229,7 @@ pub const fn from_bits(v: u32) -> Self {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[must_use]
#[inline]
pub const fn from_be_bytes(bytes: [u8; 4]) -> Self {
@@ -1248,7 +1248,7 @@ pub const fn from_bits(v: u32) -> Self {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[must_use]
#[inline]
pub const fn from_le_bytes(bytes: [u8; 4]) -> Self {
@@ -1278,7 +1278,7 @@ pub const fn from_bits(v: u32) -> Self {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[must_use]
#[inline]
pub const fn from_ne_bytes(bytes: [u8; 4]) -> Self {
+16 -16
View File
@@ -516,7 +516,7 @@ impl f64 {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
#[allow(clippy::eq_op)] // > if you intended to check if the operand is NaN, use `.is_nan()` instead :)
pub const fn is_nan(self) -> bool {
@@ -549,7 +549,7 @@ pub(crate) const fn abs_private(self) -> f64 {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_infinite(self) -> bool {
// Getting clever with transmutation can result in incorrect answers on some FPUs
@@ -574,7 +574,7 @@ pub const fn is_infinite(self) -> bool {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_finite(self) -> bool {
// There's no need to handle NaN separately: if self is NaN,
@@ -602,7 +602,7 @@ pub const fn is_finite(self) -> bool {
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[must_use]
#[stable(feature = "is_subnormal", since = "1.53.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_subnormal(self) -> bool {
matches!(self.classify(), FpCategory::Subnormal)
@@ -629,7 +629,7 @@ pub const fn is_subnormal(self) -> bool {
/// [subnormal]: https://en.wikipedia.org/wiki/Denormal_number
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_normal(self) -> bool {
matches!(self.classify(), FpCategory::Normal)
@@ -649,7 +649,7 @@ pub const fn is_normal(self) -> bool {
/// assert_eq!(inf.classify(), FpCategory::Infinite);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
pub const fn classify(self) -> FpCategory {
// We used to have complicated logic here that avoids the simple bit-based tests to work
// around buggy codegen for x87 targets (see
@@ -685,7 +685,7 @@ pub const fn classify(self) -> FpCategory {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_sign_positive(self) -> bool {
!self.is_sign_negative()
@@ -719,7 +719,7 @@ pub fn is_positive(self) -> bool {
/// ```
#[must_use]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_float_classify", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_classify", since = "1.83.0")]
#[inline]
pub const fn is_sign_negative(self) -> bool {
// IEEE754 says: isSignMinus(x) is true if and only if x has negative sign. isSignMinus
@@ -1088,7 +1088,7 @@ pub unsafe fn to_int_unchecked<Int>(self) -> Int
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[inline]
pub const fn to_bits(self) -> u64 {
// SAFETY: `u64` is a plain old datatype so we can always transmute to it.
@@ -1132,7 +1132,7 @@ pub const fn to_bits(self) -> u64 {
/// assert_eq!(v, 12.5);
/// ```
#[stable(feature = "float_bits_conv", since = "1.20.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[must_use]
#[inline]
pub const fn from_bits(v: u64) -> Self {
@@ -1156,7 +1156,7 @@ pub const fn from_bits(v: u64) -> Self {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[inline]
pub const fn to_be_bytes(self) -> [u8; 8] {
self.to_bits().to_be_bytes()
@@ -1177,7 +1177,7 @@ pub const fn from_bits(v: u64) -> Self {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[inline]
pub const fn to_le_bytes(self) -> [u8; 8] {
self.to_bits().to_le_bytes()
@@ -1211,7 +1211,7 @@ pub const fn from_bits(v: u64) -> Self {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[inline]
pub const fn to_ne_bytes(self) -> [u8; 8] {
self.to_bits().to_ne_bytes()
@@ -1229,7 +1229,7 @@ pub const fn from_bits(v: u64) -> Self {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[must_use]
#[inline]
pub const fn from_be_bytes(bytes: [u8; 8]) -> Self {
@@ -1248,7 +1248,7 @@ pub const fn from_bits(v: u64) -> Self {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[must_use]
#[inline]
pub const fn from_le_bytes(bytes: [u8; 8]) -> Self {
@@ -1278,7 +1278,7 @@ pub const fn from_bits(v: u64) -> Self {
/// assert_eq!(value, 12.5);
/// ```
#[stable(feature = "float_to_from_bytes", since = "1.40.0")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_float_bits_conv", since = "1.83.0")]
#[must_use]
#[inline]
pub const fn from_ne_bytes(bytes: [u8; 8]) -> Self {
+4 -4
View File
@@ -177,7 +177,7 @@ pub fn is_continue(&self) -> bool {
/// assert_eq!(ControlFlow::<String, i32>::Continue(3).break_value(), None);
/// ```
#[inline]
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "control_flow_enum", since = "1.83.0")]
pub fn break_value(self) -> Option<B> {
match self {
ControlFlow::Continue(..) => None,
@@ -188,7 +188,7 @@ pub fn break_value(self) -> Option<B> {
/// Maps `ControlFlow<B, C>` to `ControlFlow<T, C>` by applying a function
/// to the break value in case it exists.
#[inline]
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "control_flow_enum", since = "1.83.0")]
pub fn map_break<T>(self, f: impl FnOnce(B) -> T) -> ControlFlow<T, C> {
match self {
ControlFlow::Continue(x) => ControlFlow::Continue(x),
@@ -208,7 +208,7 @@ pub fn map_break<T>(self, f: impl FnOnce(B) -> T) -> ControlFlow<T, C> {
/// assert_eq!(ControlFlow::<String, i32>::Continue(3).continue_value(), Some(3));
/// ```
#[inline]
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "control_flow_enum", since = "1.83.0")]
pub fn continue_value(self) -> Option<C> {
match self {
ControlFlow::Continue(x) => Some(x),
@@ -219,7 +219,7 @@ pub fn continue_value(self) -> Option<C> {
/// Maps `ControlFlow<B, C>` to `ControlFlow<B, T>` by applying a function
/// to the continue value in case it exists.
#[inline]
#[stable(feature = "control_flow_enum", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "control_flow_enum", since = "1.83.0")]
pub fn map_continue<T>(self, f: impl FnOnce(C) -> T) -> ControlFlow<B, T> {
match self {
ControlFlow::Continue(x) => ControlFlow::Continue(f(x)),
+11 -11
View File
@@ -724,7 +724,7 @@ pub const fn as_ref(&self) -> Option<&T> {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn as_mut(&mut self) -> Option<&mut T> {
match *self {
Some(ref mut x) => Some(x),
@@ -926,7 +926,7 @@ pub const fn as_mut_slice(&mut self) -> &mut [T] {
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "option_expect")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn expect(self, msg: &str) -> T {
match self {
Some(val) => val,
@@ -965,7 +965,7 @@ pub const fn expect(self, msg: &str) -> T {
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "option_unwrap")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn unwrap(self) -> T {
match self {
Some(val) => val,
@@ -1073,7 +1073,7 @@ pub fn unwrap_or_default(self) -> T
#[track_caller]
#[stable(feature = "option_result_unwrap_unchecked", since = "1.58.0")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const unsafe fn unwrap_unchecked(self) -> T {
match self {
Some(val) => val,
@@ -1655,7 +1655,7 @@ pub fn get_or_insert(&mut self, value: T) -> &mut T {
/// assert_eq!(x, Some(7));
/// ```
#[inline]
#[stable(feature = "option_get_or_insert_default", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "option_get_or_insert_default", since = "1.83.0")]
pub fn get_or_insert_default(&mut self) -> &mut T
where
T: Default,
@@ -1717,7 +1717,7 @@ pub fn get_or_insert_with<F>(&mut self, f: F) -> &mut T
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn take(&mut self) -> Option<T> {
// FIXME(const-hack) replace `mem::replace` by `mem::take` when the latter is const ready
mem::replace(self, None)
@@ -1776,7 +1776,7 @@ pub fn take_if<P>(&mut self, predicate: P) -> Option<T>
#[inline]
#[stable(feature = "option_replace", since = "1.31.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn replace(&mut self, value: T) -> Option<T> {
mem::replace(self, Some(value))
}
@@ -1884,7 +1884,7 @@ impl<T> Option<&T> {
/// ```
#[must_use = "`self` will be dropped if the result is not used"]
#[stable(feature = "copied", since = "1.35.0")]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn copied(self) -> Option<T>
where
T: Copy,
@@ -1938,7 +1938,7 @@ impl<T> Option<&mut T> {
#[must_use = "`self` will be dropped if the result is not used"]
#[stable(feature = "copied", since = "1.35.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn copied(self) -> Option<T>
where
T: Copy,
@@ -1994,7 +1994,7 @@ impl<T, E> Option<Result<T, E>> {
#[inline]
#[stable(feature = "transpose_result", since = "1.33.0")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn transpose(self) -> Result<Option<T>, E> {
match self {
Some(Ok(x)) => Ok(Some(x)),
@@ -2542,7 +2542,7 @@ impl<T> Option<Option<T>> {
#[inline]
#[stable(feature = "option_flattening", since = "1.40.0")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
#[rustc_const_stable(feature = "const_option", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_option", since = "1.83.0")]
pub const fn flatten(self) -> Option<T> {
// FIXME(const-hack): could be written with `and_then`
match self {
+3 -3
View File
@@ -92,7 +92,7 @@ pub const fn cast<U>(self) -> *const U {
/// }
/// ```
#[unstable(feature = "set_ptr_value", issue = "75091")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "1.83.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub const fn with_metadata_of<U>(self, meta: *const U) -> *const U
@@ -1278,7 +1278,7 @@ pub unsafe fn read_volatile(self) -> T
/// See [`ptr::copy`] for safety concerns and examples.
///
/// [`ptr::copy`]: crate::ptr::copy()
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1298,7 +1298,7 @@ pub unsafe fn read_volatile(self) -> T
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
///
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
+3 -3
View File
@@ -92,7 +92,7 @@ pub trait Pointee {
///
/// assert_eq!(std::ptr::metadata("foo"), 3_usize);
/// ```
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "1.83.0")]
#[inline]
pub const fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata {
ptr_metadata(ptr)
@@ -106,7 +106,7 @@ pub const fn metadata<T: ?Sized>(ptr: *const T) -> <T as Pointee>::Metadata {
///
/// [`slice::from_raw_parts`]: crate::slice::from_raw_parts
#[unstable(feature = "ptr_metadata", issue = "81513")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "1.83.0")]
#[inline]
pub const fn from_raw_parts<T: ?Sized>(
data_pointer: *const impl Thin,
@@ -120,7 +120,7 @@ pub const fn from_raw_parts<T: ?Sized>(
///
/// See the documentation of [`from_raw_parts`] for more details.
#[unstable(feature = "ptr_metadata", issue = "81513")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "1.83.0")]
#[inline]
pub const fn from_raw_parts_mut<T: ?Sized>(
data_pointer: *mut impl Thin,
+4 -4
View File
@@ -992,7 +992,7 @@ pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
/// ```
#[inline]
#[stable(feature = "slice_from_raw_parts", since = "1.42.0")]
#[rustc_const_stable(feature = "const_slice_from_raw_parts_mut", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_from_raw_parts_mut", since = "1.83.0")]
#[rustc_diagnostic_item = "ptr_slice_from_raw_parts_mut"]
pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
from_raw_parts_mut(data, len)
@@ -1264,7 +1264,7 @@ macro_rules! attempt_swap_as_chunks {
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_replace", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_replace", since = "1.83.0")]
#[rustc_diagnostic_item = "ptr_replace"]
pub const unsafe fn replace<T>(dst: *mut T, src: T) -> T {
// SAFETY: the caller must guarantee that `dst` is valid to be
@@ -1612,7 +1612,7 @@ macro_rules! attempt_swap_as_chunks {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
#[rustc_diagnostic_item = "ptr_write"]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn write<T>(dst: *mut T, src: T) {
@@ -1721,7 +1721,7 @@ macro_rules! attempt_swap_as_chunks {
#[inline]
#[stable(feature = "ptr_unaligned", since = "1.17.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_refs_to_cell))]
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
#[rustc_diagnostic_item = "ptr_write_unaligned"]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn write_unaligned<T>(dst: *mut T, src: T) {
+8 -8
View File
@@ -74,7 +74,7 @@ pub const fn cast<U>(self) -> *mut U {
/// }
/// ```
#[unstable(feature = "set_ptr_value", issue = "75091")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "ptr_metadata_const", since = "1.83.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[inline]
pub const fn with_metadata_of<U>(self, meta: *const U) -> *mut U
@@ -1358,7 +1358,7 @@ pub unsafe fn read_volatile(self) -> T
/// See [`ptr::copy`] for safety concerns and examples.
///
/// [`ptr::copy`]: crate::ptr::copy()
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1378,7 +1378,7 @@ pub unsafe fn read_volatile(self) -> T
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
///
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1398,7 +1398,7 @@ pub unsafe fn read_volatile(self) -> T
/// See [`ptr::copy`] for safety concerns and examples.
///
/// [`ptr::copy`]: crate::ptr::copy()
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1418,7 +1418,7 @@ pub unsafe fn read_volatile(self) -> T
/// See [`ptr::copy_nonoverlapping`] for safety concerns and examples.
///
/// [`ptr::copy_nonoverlapping`]: crate::ptr::copy_nonoverlapping()
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
@@ -1449,7 +1449,7 @@ pub unsafe fn drop_in_place(self) {
///
/// [`ptr::write`]: crate::ptr::write()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn write(self, val: T)
@@ -1468,7 +1468,7 @@ pub unsafe fn drop_in_place(self) {
/// [`ptr::write_bytes`]: crate::ptr::write_bytes()
#[doc(alias = "memset")]
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn write_bytes(self, val: u8, count: usize)
@@ -1509,7 +1509,7 @@ pub unsafe fn write_volatile(self, val: T)
///
/// [`ptr::write_unaligned`]: crate::ptr::write_unaligned()
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn write_unaligned(self, val: T)
+9 -12
View File
@@ -395,7 +395,7 @@ pub const fn as_ptr(self) -> *mut T {
/// [the module documentation]: crate::ptr#safety
#[stable(feature = "nonnull", since = "1.25.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_ptr_as_ref", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_as_ref", since = "1.83.0")]
#[must_use]
#[inline(always)]
pub const unsafe fn as_mut<'a>(&mut self) -> &'a mut T {
@@ -923,7 +923,7 @@ pub unsafe fn read_volatile(self) -> T
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
pub const unsafe fn copy_to(self, dest: NonNull<T>, count: usize)
where
T: Sized,
@@ -943,7 +943,7 @@ pub unsafe fn read_volatile(self) -> T
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
pub const unsafe fn copy_to_nonoverlapping(self, dest: NonNull<T>, count: usize)
where
T: Sized,
@@ -963,7 +963,7 @@ pub unsafe fn read_volatile(self) -> T
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
pub const unsafe fn copy_from(self, src: NonNull<T>, count: usize)
where
T: Sized,
@@ -983,7 +983,7 @@ pub unsafe fn read_volatile(self) -> T
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.83.0")]
pub const unsafe fn copy_from_nonoverlapping(self, src: NonNull<T>, count: usize)
where
T: Sized,
@@ -1013,7 +1013,7 @@ pub unsafe fn drop_in_place(self) {
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
pub const unsafe fn write(self, val: T)
where
T: Sized,
@@ -1032,7 +1032,7 @@ pub unsafe fn drop_in_place(self) {
#[doc(alias = "memset")]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
pub const unsafe fn write_bytes(self, val: u8, count: usize)
where
T: Sized,
@@ -1073,7 +1073,7 @@ pub unsafe fn write_volatile(self, val: T)
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
#[stable(feature = "non_null_convenience", since = "1.80.0")]
#[rustc_const_stable(feature = "const_ptr_write", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
pub const unsafe fn write_unaligned(self, val: T)
where
T: Sized,
@@ -1432,10 +1432,7 @@ impl<T> NonNull<[T]> {
/// (Note that this example artificially demonstrates a use of this method,
/// but `let slice = NonNull::from(&x[..]);` would be a better way to write code like this.)
#[stable(feature = "nonnull_slice_from_raw_parts", since = "1.70.0")]
#[rustc_const_stable(
feature = "const_slice_from_raw_parts_mut",
since = "CURRENT_RUSTC_VERSION"
)]
#[rustc_const_stable(feature = "const_slice_from_raw_parts_mut", since = "1.83.0")]
#[must_use]
#[inline]
pub const fn slice_from_raw_parts(data: NonNull<T>, len: usize) -> Self {
+4 -4
View File
@@ -734,7 +734,7 @@ pub const fn as_ref(&self) -> Result<&T, &E> {
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_result", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn as_mut(&mut self) -> Result<&mut T, &mut E> {
match *self {
@@ -1537,7 +1537,7 @@ impl<T, E> Result<&T, E> {
/// ```
#[inline]
#[stable(feature = "result_copied", since = "1.59.0")]
#[rustc_const_stable(feature = "const_result", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
pub const fn copied(self) -> Result<T, E>
where
@@ -1588,7 +1588,7 @@ impl<T, E> Result<&mut T, E> {
/// ```
#[inline]
#[stable(feature = "result_copied", since = "1.59.0")]
#[rustc_const_stable(feature = "const_result", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
pub const fn copied(self) -> Result<T, E>
@@ -1643,7 +1643,7 @@ impl<T, E> Result<Option<T>, E> {
/// ```
#[inline]
#[stable(feature = "transpose_result", since = "1.33.0")]
#[rustc_const_stable(feature = "const_result", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_result", since = "1.83.0")]
#[rustc_allow_const_fn_unstable(const_precise_live_drops)]
pub const fn transpose(self) -> Option<Result<T, E>> {
match self {
+11 -11
View File
@@ -172,7 +172,7 @@ pub const fn first(&self) -> Option<&T> {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_slice_first_last", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_first_last", since = "1.83.0")]
#[inline]
#[must_use]
pub const fn first_mut(&mut self) -> Option<&mut T> {
@@ -215,7 +215,7 @@ pub const fn split_first(&self) -> Option<(&T, &[T])> {
/// ```
#[stable(feature = "slice_splits", since = "1.5.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_slice_first_last", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_first_last", since = "1.83.0")]
#[inline]
#[must_use]
pub const fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])> {
@@ -258,7 +258,7 @@ pub const fn split_last(&self) -> Option<(&T, &[T])> {
/// ```
#[stable(feature = "slice_splits", since = "1.5.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_slice_first_last", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_first_last", since = "1.83.0")]
#[inline]
#[must_use]
pub const fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])> {
@@ -301,7 +301,7 @@ pub const fn last(&self) -> Option<&T> {
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_slice_first_last", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_first_last", since = "1.83.0")]
#[inline]
#[must_use]
pub const fn last_mut(&mut self) -> Option<&mut T> {
@@ -356,7 +356,7 @@ pub const fn last_mut(&mut self) -> Option<&mut T> {
/// ```
#[inline]
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]> {
if self.len() < N {
@@ -422,7 +422,7 @@ pub const fn last_mut(&mut self) -> Option<&mut T> {
/// ```
#[inline]
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn split_first_chunk_mut<const N: usize>(
&mut self,
@@ -493,7 +493,7 @@ pub const fn split_first_chunk_mut<const N: usize>(
/// ```
#[inline]
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn split_last_chunk_mut<const N: usize>(
&mut self,
@@ -563,7 +563,7 @@ pub const fn split_last_chunk_mut<const N: usize>(
/// ```
#[inline]
#[stable(feature = "slice_first_last_chunk", since = "1.77.0")]
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_first_last_chunk", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]> {
if self.len() < N {
@@ -1907,7 +1907,7 @@ pub const fn split_at(&self, mid: usize) -> (&[T], &[T]) {
#[inline]
#[track_caller]
#[must_use]
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
match self.split_at_mut_checked(mid) {
@@ -2010,7 +2010,7 @@ pub const fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {
/// assert_eq!(v, [1, 2, 3, 4, 5, 6]);
/// ```
#[stable(feature = "slice_split_at_unchecked", since = "1.79.0")]
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[inline]
#[must_use]
@@ -2111,7 +2111,7 @@ pub const fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])> {
/// assert_eq!(None, v.split_at_mut_checked(7));
/// ```
#[stable(feature = "split_at_checked", since = "1.80.0")]
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_split_at_mut", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[inline]
#[must_use]
+2 -2
View File
@@ -171,7 +171,7 @@
/// [`NonNull::dangling()`]: ptr::NonNull::dangling
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "const_slice_from_raw_parts_mut", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_from_raw_parts_mut", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[must_use]
#[rustc_diagnostic_item = "slice_from_raw_parts_mut"]
@@ -204,7 +204,7 @@ pub const fn from_ref<T>(s: &T) -> &[T] {
/// Converts a reference to T into a slice of length 1 (without copying).
#[stable(feature = "from_ref", since = "1.28.0")]
#[rustc_const_stable(feature = "const_slice_from_ref", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_slice_from_ref", since = "1.83.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[must_use]
pub const fn from_mut<T>(s: &mut T) -> &mut [T] {
+1 -4
View File
@@ -196,10 +196,7 @@ pub const fn from_utf8_mut(v: &mut [u8]) -> Result<&mut str, Utf8Error> {
#[must_use]
#[stable(feature = "str_mut_extras", since = "1.20.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(
feature = "const_str_from_utf8_unchecked_mut",
since = "CURRENT_RUSTC_VERSION"
)]
#[rustc_const_stable(feature = "const_str_from_utf8_unchecked_mut", since = "1.83.0")]
#[rustc_diagnostic_item = "str_from_utf8_unchecked_mut"]
pub const unsafe fn from_utf8_unchecked_mut(v: &mut [u8]) -> &mut str {
// SAFETY: the caller must guarantee that the bytes `v`
+2 -2
View File
@@ -340,7 +340,7 @@ pub const fn as_bytes(&self) -> &[u8] {
/// ```
#[stable(feature = "str_mut_extras", since = "1.20.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_str_as_mut", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_str_as_mut", since = "1.83.0")]
#[must_use]
#[inline(always)]
pub const unsafe fn as_bytes_mut(&mut self) -> &mut [u8] {
@@ -387,7 +387,7 @@ pub const fn as_ptr(&self) -> *const u8 {
/// modified in a way that it remains valid UTF-8.
#[stable(feature = "str_as_mut_ptr", since = "1.36.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_str_as_mut", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "const_str_as_mut", since = "1.83.0")]
#[rustc_never_returns_null_ptr]
#[must_use]
#[inline(always)]
+4 -4
View File
@@ -519,8 +519,8 @@ pub fn will_wake(&self, other: &Waker) -> bool {
/// [`Wake`]: ../../alloc/task/trait.Wake.html
#[inline]
#[must_use]
#[stable(feature = "waker_getters", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "waker_getters", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "waker_getters", since = "1.83.0")]
#[rustc_const_stable(feature = "waker_getters", since = "1.83.0")]
pub const unsafe fn new(data: *const (), vtable: &'static RawWakerVTable) -> Self {
Waker { waker: RawWaker { data, vtable } }
}
@@ -584,7 +584,7 @@ pub const fn noop() -> &'static Waker {
/// Gets the `data` pointer used to create this `Waker`.
#[inline]
#[must_use]
#[stable(feature = "waker_getters", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "waker_getters", since = "1.83.0")]
pub fn data(&self) -> *const () {
self.waker.data
}
@@ -592,7 +592,7 @@ pub fn data(&self) -> *const () {
/// Gets the `vtable` pointer used to create this `Waker`.
#[inline]
#[must_use]
#[stable(feature = "waker_getters", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "waker_getters", since = "1.83.0")]
pub fn vtable(&self) -> &'static RawWakerVTable {
self.waker.vtable
}
+4 -4
View File
@@ -846,7 +846,7 @@ pub const fn checked_div(self, rhs: u32) -> Option<Duration> {
#[stable(feature = "duration_float", since = "1.38.0")]
#[must_use]
#[inline]
#[rustc_const_stable(feature = "duration_consts_float", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "duration_consts_float", since = "1.83.0")]
pub const fn as_secs_f64(&self) -> f64 {
(self.secs as f64) + (self.nanos.0 as f64) / (NANOS_PER_SEC as f64)
}
@@ -865,7 +865,7 @@ pub const fn as_secs_f64(&self) -> f64 {
#[stable(feature = "duration_float", since = "1.38.0")]
#[must_use]
#[inline]
#[rustc_const_stable(feature = "duration_consts_float", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "duration_consts_float", since = "1.83.0")]
pub const fn as_secs_f32(&self) -> f32 {
(self.secs as f32) + (self.nanos.0 as f32) / (NANOS_PER_SEC as f32)
}
@@ -1086,7 +1086,7 @@ pub fn div_f32(self, rhs: f32) -> Duration {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
#[rustc_const_stable(feature = "duration_consts_float", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "duration_consts_float", since = "1.83.0")]
pub const fn div_duration_f64(self, rhs: Duration) -> f64 {
let self_nanos = (self.secs as f64) * (NANOS_PER_SEC as f64) + (self.nanos.0 as f64);
let rhs_nanos = (rhs.secs as f64) * (NANOS_PER_SEC as f64) + (rhs.nanos.0 as f64);
@@ -1107,7 +1107,7 @@ pub const fn div_duration_f64(self, rhs: Duration) -> f64 {
#[must_use = "this returns the result of the operation, \
without modifying the original"]
#[inline]
#[rustc_const_stable(feature = "duration_consts_float", since = "CURRENT_RUSTC_VERSION")]
#[rustc_const_stable(feature = "duration_consts_float", since = "1.83.0")]
pub const fn div_duration_f32(self, rhs: Duration) -> f32 {
let self_nanos = (self.secs as f32) * (NANOS_PER_SEC as f32) + (self.nanos.0 as f32);
let rhs_nanos = (rhs.secs as f32) * (NANOS_PER_SEC as f32) + (rhs.nanos.0 as f32);
+10 -10
View File
@@ -1438,7 +1438,7 @@ fn clone(&self) -> Self {
}
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K, V> Default for Iter<'_, K, V> {
#[inline]
fn default() -> Self {
@@ -1484,7 +1484,7 @@ pub(super) fn iter(&self) -> Iter<'_, K, V> {
}
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K, V> Default for IterMut<'_, K, V> {
#[inline]
fn default() -> Self {
@@ -1522,7 +1522,7 @@ pub(super) fn iter(&self) -> Iter<'_, K, V> {
}
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K, V> Default for IntoIter<K, V> {
#[inline]
fn default() -> Self {
@@ -1562,7 +1562,7 @@ fn clone(&self) -> Self {
}
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K, V> Default for Keys<'_, K, V> {
#[inline]
fn default() -> Self {
@@ -1609,7 +1609,7 @@ fn clone(&self) -> Self {
}
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K, V> Default for Values<'_, K, V> {
#[inline]
fn default() -> Self {
@@ -1705,7 +1705,7 @@ pub struct ValuesMut<'a, K: 'a, V: 'a> {
inner: IterMut<'a, K, V>,
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K, V> Default for ValuesMut<'_, K, V> {
#[inline]
fn default() -> Self {
@@ -1735,7 +1735,7 @@ pub struct IntoKeys<K, V> {
inner: IntoIter<K, V>,
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K, V> Default for IntoKeys<K, V> {
#[inline]
fn default() -> Self {
@@ -1765,7 +1765,7 @@ pub struct IntoValues<K, V> {
inner: IntoIter<K, V>,
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K, V> Default for IntoValues<K, V> {
#[inline]
fn default() -> Self {
@@ -2865,7 +2865,7 @@ pub fn and_modify<F>(self, f: F) -> Self
/// assert_eq!(entry.key(), &"poneyland");
/// ```
#[inline]
#[stable(feature = "entry_insert", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "entry_insert", since = "1.83.0")]
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
match self {
Occupied(mut entry) => {
@@ -3152,7 +3152,7 @@ pub fn insert(self, value: V) -> &'a mut V {
/// assert_eq!(map["poneyland"], 37);
/// ```
#[inline]
#[stable(feature = "entry_insert", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "entry_insert", since = "1.83.0")]
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
let base = self.base.insert_entry(value);
OccupiedEntry { base }
+2 -2
View File
@@ -1244,7 +1244,7 @@ pub struct Iter<'a, K: 'a> {
base: base::Iter<'a, K>,
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K> Default for Iter<'_, K> {
#[inline]
fn default() -> Self {
@@ -1273,7 +1273,7 @@ pub struct IntoIter<K> {
base: base::IntoIter<K>,
}
#[stable(feature = "default_iters_hash", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "default_iters_hash", since = "1.83.0")]
impl<K> Default for IntoIter<K> {
#[inline]
fn default() -> Self {
+16 -16
View File
@@ -223,10 +223,10 @@ pub enum ErrorKind {
#[stable(feature = "rust1", since = "1.0.0")]
ConnectionReset,
/// The remote host is not reachable.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
HostUnreachable,
/// The network containing the remote host is not reachable.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
NetworkUnreachable,
/// The connection was aborted (terminated) by the remote server.
#[stable(feature = "rust1", since = "1.0.0")]
@@ -243,7 +243,7 @@ pub enum ErrorKind {
#[stable(feature = "rust1", since = "1.0.0")]
AddrNotAvailable,
/// The system's networking is down.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
NetworkDown,
/// The operation failed because a pipe was closed.
#[stable(feature = "rust1", since = "1.0.0")]
@@ -259,18 +259,18 @@ pub enum ErrorKind {
///
/// For example, a filesystem path was specified where one of the intermediate directory
/// components was, in fact, a plain file.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
NotADirectory,
/// The filesystem object is, unexpectedly, a directory.
///
/// A directory was specified when a non-directory was expected.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
IsADirectory,
/// A non-empty directory was specified where an empty directory was expected.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
DirectoryNotEmpty,
/// The filesystem or storage medium is read-only, but a write operation was attempted.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
ReadOnlyFilesystem,
/// Loop in the filesystem or IO subsystem; often, too many levels of symbolic links.
///
@@ -285,7 +285,7 @@ pub enum ErrorKind {
///
/// With some network filesystems, notably NFS, an open file (or directory) can be invalidated
/// by problems with the network or server.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
StaleNetworkFileHandle,
/// A parameter was incorrect.
#[stable(feature = "rust1", since = "1.0.0")]
@@ -319,13 +319,13 @@ pub enum ErrorKind {
/// The underlying storage (typically, a filesystem) is full.
///
/// This does not include out of quota errors.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
StorageFull,
/// Seek on unseekable file.
///
/// Seeking was attempted on an open file handle which is not suitable for seeking - for
/// example, on Unix, a named pipe opened with `File::open`.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
NotSeekable,
/// Filesystem quota was exceeded.
#[unstable(feature = "io_error_more", issue = "86442")]
@@ -335,22 +335,22 @@ pub enum ErrorKind {
/// This might arise from a hard limit of the underlying filesystem or file access API, or from
/// an administratively imposed resource limitation. Simple disk full, and out of quota, have
/// their own errors.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
FileTooLarge,
/// Resource is busy.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
ResourceBusy,
/// Executable file is busy.
///
/// An attempt was made to write to a file which is also in use as a running program. (Not all
/// operating systems detect this situation.)
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
ExecutableFileBusy,
/// Deadlock (avoided).
///
/// A file locking operation would result in deadlock. This situation is typically detected, if
/// at all, on a best-effort basis.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
Deadlock,
/// Cross-device or cross-filesystem (hard) link or rename.
#[unstable(feature = "io_error_more", issue = "86442")]
@@ -358,7 +358,7 @@ pub enum ErrorKind {
/// Too many (hard) links to the same filesystem object.
///
/// The filesystem does not support making so many hardlinks to the same file.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
TooManyLinks,
/// A filename was invalid.
///
@@ -369,7 +369,7 @@ pub enum ErrorKind {
///
/// When trying to run an external program, a system or process limit on the size of the
/// arguments would have been exceeded.
#[stable(feature = "io_error_a_bit_more", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "io_error_a_bit_more", since = "1.83.0")]
ArgumentListTooLong,
/// This operation was interrupted.
///
+1 -1
View File
@@ -2405,7 +2405,7 @@ fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> Result<usize> {
/// assert_eq!(num_bytes, 11);
/// assert_eq!(animal, b"Crustacean\0");
/// ```
#[stable(feature = "bufread_skip_until", since = "CURRENT_RUSTC_VERSION")]
#[stable(feature = "bufread_skip_until", since = "1.83.0")]
fn skip_until(&mut self, byte: u8) -> Result<usize> {
skip_until(self, byte)
}
+11 -6
View File
@@ -2748,13 +2748,18 @@ fn download_ci_rustc_commit(
}
};
// Look for a version to compare to based on the current commit.
// Only commits merged by bors will have CI artifacts.
let commit = get_closest_merge_commit(Some(&self.src), &self.git_config(), &[
let files_to_track = &[
self.src.join("compiler"),
self.src.join("library"),
])
.unwrap();
self.src.join("src/version"),
self.src.join("src/stage0"),
self.src.join("src/ci/channel"),
];
// Look for a version to compare to based on the current commit.
// Only commits merged by bors will have CI artifacts.
let commit =
get_closest_merge_commit(Some(&self.src), &self.git_config(), files_to_track).unwrap();
if commit.is_empty() {
println!("ERROR: could not find commit hash for downloading rustc");
println!("HELP: maybe your repository history is too shallow?");
@@ -2780,7 +2785,7 @@ fn download_ci_rustc_commit(
let has_changes = !t!(helpers::git(Some(&self.src))
.args(["diff-index", "--quiet", &commit])
.arg("--")
.args([self.src.join("compiler"), self.src.join("library")])
.args(files_to_track)
.as_command_mut()
.status())
.success();
+1 -1
View File
@@ -1 +1 @@
nightly
beta