parent
9ce3675b43
commit
f204e2c23b
31 changed files with 170 additions and 179 deletions
|
@ -116,7 +116,7 @@ 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 @@ 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 @@ 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.
|
||||
|
|
|
@ -156,7 +156,7 @@ 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 @@ 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),
|
||||
|
|
|
@ -228,7 +228,7 @@ declare_features! (
|
|||
/// 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 @@ declare_features! (
|
|||
/// 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 @@ declare_features! (
|
|||
/// 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 @@ declare_features! (
|
|||
/// 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 @@ declare_features! (
|
|||
/// 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 @@ declare_features! (
|
|||
/// 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.
|
||||
|
|
|
@ -146,7 +146,7 @@ pub const fn from_ref<T>(s: &T) -> &[T; 1] {
|
|||
|
||||
/// 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.
|
||||
|
|
|
@ -515,7 +515,7 @@ impl<T> Cell<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 @@ impl<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 @@ impl<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 @@ impl<T: ?Sized> UnsafeCell<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
|
||||
}
|
||||
|
|
|
@ -309,7 +309,7 @@ impl<T> OnceCell<T> {
|
|||
/// ```
|
||||
#[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
|
||||
|
|
|
@ -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 @@ impl char {
|
|||
/// 'ß'.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 {
|
||||
|
@ -1773,7 +1773,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)]
|
||||
|
|
|
@ -383,7 +383,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
|
|||
/// "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 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
|
|||
/// "{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 @@ impl<'a, 'b: 'a> DebugList<'a, 'b> {
|
|||
/// "[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 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
|
|||
/// 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");
|
||||
|
|
|
@ -1085,7 +1085,7 @@ extern "rust-intrinsic" {
|
|||
/// 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);
|
||||
|
@ -2541,7 +2541,7 @@ extern "rust-intrinsic" {
|
|||
/// 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);
|
||||
|
||||
|
@ -3070,7 +3070,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 {
|
||||
|
@ -3095,7 +3095,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 {
|
||||
|
@ -3196,13 +3196,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);
|
||||
}
|
||||
|
@ -3300,13 +3300,13 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
|
|||
#[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);
|
||||
}
|
||||
|
@ -3381,13 +3381,13 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
|
|||
#[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);
|
||||
}
|
||||
|
|
|
@ -569,10 +569,7 @@ impl<T> MaybeUninit<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 {
|
||||
|
|
|
@ -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!
|
||||
|
|
|
@ -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 @@ 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]
|
||||
pub const fn is_infinite(self) -> bool {
|
||||
// Getting clever with transmutation can result in incorrect answers on some FPUs
|
||||
|
@ -575,7 +575,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]
|
||||
pub const fn is_finite(self) -> bool {
|
||||
// There's no need to handle NaN separately: if self is NaN,
|
||||
|
@ -603,7 +603,7 @@ impl f32 {
|
|||
/// [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 @@ impl f32 {
|
|||
/// [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 @@ impl f32 {
|
|||
/// 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 @@ 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]
|
||||
pub const fn is_sign_positive(self) -> bool {
|
||||
!self.is_sign_negative()
|
||||
|
@ -711,7 +711,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]
|
||||
pub const fn is_sign_negative(self) -> bool {
|
||||
// IEEE754 says: isSignMinus(x) is true if and only if x has negative sign. isSignMinus
|
||||
|
@ -1093,7 +1093,7 @@ impl f32 {
|
|||
#[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.
|
||||
|
@ -1137,7 +1137,7 @@ impl f32 {
|
|||
/// 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 {
|
||||
|
@ -1161,7 +1161,7 @@ impl f32 {
|
|||
#[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()
|
||||
|
@ -1182,7 +1182,7 @@ impl f32 {
|
|||
#[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()
|
||||
|
@ -1216,7 +1216,7 @@ impl f32 {
|
|||
#[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()
|
||||
|
@ -1234,7 +1234,7 @@ impl f32 {
|
|||
/// 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 {
|
||||
|
@ -1253,7 +1253,7 @@ impl f32 {
|
|||
/// 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 {
|
||||
|
@ -1283,7 +1283,7 @@ impl f32 {
|
|||
/// 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 {
|
||||
|
|
|
@ -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 @@ 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]
|
||||
pub const fn is_infinite(self) -> bool {
|
||||
// Getting clever with transmutation can result in incorrect answers on some FPUs
|
||||
|
@ -574,7 +574,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]
|
||||
pub const fn is_finite(self) -> bool {
|
||||
// There's no need to handle NaN separately: if self is NaN,
|
||||
|
@ -602,7 +602,7 @@ impl f64 {
|
|||
/// [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 @@ impl f64 {
|
|||
/// [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 @@ impl f64 {
|
|||
/// 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 @@ 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]
|
||||
pub const fn is_sign_positive(self) -> bool {
|
||||
!self.is_sign_negative()
|
||||
|
@ -719,7 +719,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]
|
||||
pub const fn is_sign_negative(self) -> bool {
|
||||
// IEEE754 says: isSignMinus(x) is true if and only if x has negative sign. isSignMinus
|
||||
|
@ -1093,7 +1093,7 @@ impl f64 {
|
|||
#[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.
|
||||
|
@ -1137,7 +1137,7 @@ impl f64 {
|
|||
/// 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 {
|
||||
|
@ -1161,7 +1161,7 @@ impl f64 {
|
|||
#[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()
|
||||
|
@ -1182,7 +1182,7 @@ impl f64 {
|
|||
#[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()
|
||||
|
@ -1216,7 +1216,7 @@ impl f64 {
|
|||
#[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()
|
||||
|
@ -1234,7 +1234,7 @@ impl f64 {
|
|||
/// 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 {
|
||||
|
@ -1253,7 +1253,7 @@ impl f64 {
|
|||
/// 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 {
|
||||
|
@ -1283,7 +1283,7 @@ impl f64 {
|
|||
/// 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 {
|
||||
|
|
|
@ -177,7 +177,7 @@ impl<B, C> ControlFlow<B, C> {
|
|||
/// 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 @@ impl<B, C> ControlFlow<B, C> {
|
|||
/// 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 @@ impl<B, C> ControlFlow<B, 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 @@ impl<B, C> ControlFlow<B, 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)),
|
||||
|
|
|
@ -724,7 +724,7 @@ impl<T> 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 @@ impl<T> Option<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 @@ impl<T> Option<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 @@ impl<T> Option<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 @@ impl<T> Option<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 @@ impl<T> 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 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 @@ impl<T> 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 {
|
||||
|
|
|
@ -113,7 +113,7 @@ impl<T: ?Sized> *const T {
|
|||
/// println!("{:?}", unsafe { &*bad });
|
||||
/// ```
|
||||
#[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
|
||||
|
@ -1299,7 +1299,7 @@ impl<T: ?Sized> *const 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
|
||||
|
@ -1319,7 +1319,7 @@ impl<T: ?Sized> *const 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
|
||||
|
|
|
@ -92,7 +92,7 @@ pub trait Thin = Pointee<Metadata = ()>;
|
|||
///
|
||||
/// 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,
|
||||
|
|
|
@ -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)
|
||||
|
@ -1266,7 +1266,7 @@ const unsafe fn swap_nonoverlapping_simple_untyped<T>(x: *mut T, y: *mut T, coun
|
|||
#[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
|
||||
|
@ -1616,7 +1616,7 @@ pub const unsafe fn read_unaligned<T>(src: *const T) -> T {
|
|||
/// ```
|
||||
#[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) {
|
||||
|
@ -1726,7 +1726,7 @@ pub const unsafe fn write<T>(dst: *mut T, src: T) {
|
|||
#[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) {
|
||||
|
|
|
@ -94,7 +94,7 @@ impl<T: ?Sized> *mut T {
|
|||
/// // This dereference is UB. The pointer only has provenance for `x` but points to `y`.
|
||||
/// println!("{:?}", unsafe { &*bad });
|
||||
#[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
|
||||
|
@ -1378,7 +1378,7 @@ impl<T: ?Sized> *mut 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
|
||||
|
@ -1398,7 +1398,7 @@ impl<T: ?Sized> *mut 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
|
||||
|
@ -1418,7 +1418,7 @@ impl<T: ?Sized> *mut 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
|
||||
|
@ -1438,7 +1438,7 @@ impl<T: ?Sized> *mut 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
|
||||
|
@ -1469,7 +1469,7 @@ impl<T: ?Sized> *mut T {
|
|||
///
|
||||
/// [`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)
|
||||
|
@ -1488,7 +1488,7 @@ impl<T: ?Sized> *mut T {
|
|||
/// [`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)
|
||||
|
@ -1529,7 +1529,7 @@ impl<T: ?Sized> *mut 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)
|
||||
|
|
|
@ -395,7 +395,7 @@ impl<T: ?Sized> NonNull<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 @@ impl<T: ?Sized> NonNull<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 @@ impl<T: ?Sized> NonNull<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 @@ impl<T: ?Sized> NonNull<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 @@ impl<T: ?Sized> NonNull<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 @@ impl<T: ?Sized> NonNull<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(self, val: T)
|
||||
where
|
||||
T: Sized,
|
||||
|
@ -1032,7 +1032,7 @@ impl<T: ?Sized> NonNull<T> {
|
|||
#[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 @@ impl<T: ?Sized> NonNull<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 {
|
||||
|
|
|
@ -734,7 +734,7 @@ impl<T, E> 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 {
|
||||
|
|
|
@ -172,7 +172,7 @@ impl<T> [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 @@ impl<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 @@ impl<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 @@ impl<T> [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 @@ impl<T> [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 @@ impl<T> [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 @@ impl<T> [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_last_chunk_mut<const N: usize>(
|
||||
&mut self,
|
||||
|
@ -563,7 +563,7 @@ impl<T> [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 last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]> {
|
||||
if self.len() < N {
|
||||
|
@ -1907,7 +1907,7 @@ impl<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 @@ impl<T> [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 @@ impl<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]
|
||||
|
|
|
@ -171,7 +171,7 @@ pub const unsafe fn from_raw_parts<'a, T>(data: *const T, len: usize) -> &'a [T]
|
|||
/// [`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] {
|
||||
|
|
|
@ -196,10 +196,7 @@ pub const unsafe fn from_utf8_unchecked(v: &[u8]) -> &str {
|
|||
#[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`
|
||||
|
|
|
@ -340,7 +340,7 @@ impl str {
|
|||
/// ```
|
||||
#[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 @@ impl str {
|
|||
/// 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)]
|
||||
|
|
|
@ -519,8 +519,8 @@ impl Waker {
|
|||
/// [`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 @@ impl 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 @@ impl Waker {
|
|||
/// 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
|
||||
}
|
||||
|
|
|
@ -844,7 +844,7 @@ impl 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)
|
||||
}
|
||||
|
@ -863,7 +863,7 @@ impl 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_f32(&self) -> f32 {
|
||||
(self.secs as f32) + (self.nanos.0 as f32) / (NANOS_PER_SEC as f32)
|
||||
}
|
||||
|
@ -1084,7 +1084,7 @@ impl 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);
|
||||
|
@ -1105,7 +1105,7 @@ impl 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_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);
|
||||
|
|
|
@ -1438,7 +1438,7 @@ impl<K, V> Clone for 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 Iter<'_, K, V> {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
|
@ -1484,7 +1484,7 @@ impl<'a, K, V> 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 IterMut<'_, K, V> {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
|
@ -1522,7 +1522,7 @@ impl<K, V> 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 IntoIter<K, V> {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
|
@ -1562,7 +1562,7 @@ impl<K, V> Clone for Keys<'_, 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 Keys<'_, K, V> {
|
||||
#[inline]
|
||||
fn default() -> Self {
|
||||
|
@ -1609,7 +1609,7 @@ impl<K, V> Clone for Values<'_, 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 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 @@ impl<'a, K, V> Entry<'a, K, V> {
|
|||
/// 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 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, 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 }
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -2405,7 +2405,7 @@ pub trait BufRead: Read {
|
|||
/// 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)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue