Skip to content

Commit

Permalink
Auto merge of rust-lang#131767 - cuviper:bump-stage0, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
  • Loading branch information
bors committed Oct 16, 2024
2 parents cdbd127 + 43f97fb commit f7b3231
Show file tree
Hide file tree
Showing 38 changed files with 159 additions and 260 deletions.
2 changes: 0 additions & 2 deletions alloc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,6 @@
//
// Language features:
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(const_mut_refs))]
#![cfg_attr(bootstrap, feature(const_refs_to_cell))]
#![cfg_attr(not(test), feature(coroutine_trait))]
#![cfg_attr(test, feature(panic_update_hook))]
#![cfg_attr(test, feature(test))]
Expand Down
1 change: 0 additions & 1 deletion alloc/tests/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#![feature(btree_extract_if)]
#![feature(cow_is_borrowed)]
#![feature(const_heap)]
#![cfg_attr(bootstrap, feature(const_mut_refs))]
#![feature(const_try)]
#![feature(core_intrinsics)]
#![feature(extract_if)]
Expand Down
2 changes: 1 addition & 1 deletion alloc/tests/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ fn test_from_iter_specialization_panic_during_iteration_drops() {
#[test]
#[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
// FIXME(static_mut_refs): Do not allow `static_mut_refs` lint
#[cfg_attr(not(bootstrap), allow(static_mut_refs))]
#[allow(static_mut_refs)]
fn test_from_iter_specialization_panic_during_drop_doesnt_leak() {
static mut DROP_COUNTER_OLD: [usize; 5] = [0; 5];
static mut DROP_COUNTER_NEW: [usize; 2] = [0; 2];
Expand Down
35 changes: 0 additions & 35 deletions core/src/arch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#[allow(unused_imports)]
#[stable(feature = "simd_arch", since = "1.27.0")]
pub use crate::core_arch::arch::*;
#[unstable(feature = "naked_functions", issue = "90957")]
#[cfg(bootstrap)]
pub use crate::naked_asm;

/// Inline assembly.
///
Expand All @@ -20,37 +17,6 @@ pub macro asm("assembly template", $(operands,)* $(options($(option),*))?) {
/* compiler built-in */
}

/// Inline assembly used in combination with `#[naked]` functions.
///
/// Refer to [Rust By Example] for a usage guide and the [reference] for
/// detailed information about the syntax and available options.
///
/// [Rust By Example]: https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
#[unstable(feature = "naked_functions", issue = "90957")]
#[macro_export]
#[cfg(bootstrap)]
macro_rules! naked_asm {
([$last:expr], [$($pushed:expr),*]) => {
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]
{
core::arch::asm!($($pushed),*, options(att_syntax, noreturn))
}
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
{
core::arch::asm!($($pushed),* , $last, options(noreturn))
}
};

([$first:expr $(, $rest:expr)*], [$($pushed:expr),*]) => {
naked_asm!([$($rest),*], [$($pushed,)* $first]);
};

($($expr:expr),* $(,)?) => {
naked_asm!([$($expr),*], []);
};
}

/// Inline assembly used in combination with `#[naked]` functions.
///
/// Refer to [Rust By Example] for a usage guide and the [reference] for
Expand All @@ -60,7 +26,6 @@ macro_rules! naked_asm {
/// [reference]: https://doc.rust-lang.org/nightly/reference/inline-assembly.html
#[unstable(feature = "naked_functions", issue = "90957")]
#[rustc_builtin_macro]
#[cfg(not(bootstrap))]
pub macro naked_asm("assembly template", $(operands,)* $(options($(option),*))?) {
/* compiler built-in */
}
Expand Down
3 changes: 1 addition & 2 deletions core/src/array/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +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")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_array_from_ref", since = "1.83.0")]
pub const fn from_mut<T>(s: &mut T) -> &mut [T; 1] {
// SAFETY: Converting `&mut T` to `&mut [T; 1]` is sound.
unsafe { &mut *(s as *mut T).cast::<[T; 1]>() }
Expand Down
9 changes: 4 additions & 5 deletions core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -2181,8 +2181,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
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/cell/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions core/src/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`.
Expand Down Expand Up @@ -674,9 +674,8 @@ 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 {
// SAFETY: `char` is not a surrogate, so this is valid UTF-8.
unsafe { from_utf8_unchecked_mut(encode_utf8_raw(self as u32, dst)) }
Expand Down Expand Up @@ -1284,7 +1283,6 @@ impl char {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn make_ascii_uppercase(&mut self) {
*self = self.to_ascii_uppercase();
}
Expand All @@ -1311,7 +1309,6 @@ impl char {
#[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")]
#[rustc_const_stable(feature = "const_make_ascii", since = "CURRENT_RUSTC_VERSION")]
#[inline]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn make_ascii_lowercase(&mut self) {
*self = self.to_ascii_lowercase();
}
Expand Down Expand Up @@ -1773,11 +1770,10 @@ 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)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
pub const fn encode_utf8_raw(code: u32, dst: &mut [u8]) -> &mut [u8] {
const fn panic_at_const(_code: u32, _len: usize, _dst_len: usize) {
// Note that we cannot format in constant expressions.
Expand Down
8 changes: 4 additions & 4 deletions core/src/fmt/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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");
Expand Down
24 changes: 10 additions & 14 deletions core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1807,7 +1807,6 @@ extern "rust-intrinsic" {
/// is selected, and that may depend on optimization level and context, for
/// example.
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn fmuladdf16(a: f16, b: f16, c: f16) -> f16;
/// Returns `a * b + c` for `f32` values, non-deterministically executing
/// either a fused multiply-add or two operations with rounding of the
Expand All @@ -1820,7 +1819,6 @@ extern "rust-intrinsic" {
/// is selected, and that may depend on optimization level and context, for
/// example.
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn fmuladdf32(a: f32, b: f32, c: f32) -> f32;
/// Returns `a * b + c` for `f64` values, non-deterministically executing
/// either a fused multiply-add or two operations with rounding of the
Expand All @@ -1833,7 +1831,6 @@ extern "rust-intrinsic" {
/// is selected, and that may depend on optimization level and context, for
/// example.
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn fmuladdf64(a: f64, b: f64, c: f64) -> f64;
/// Returns `a * b + c` for `f128` values, non-deterministically executing
/// either a fused multiply-add or two operations with rounding of the
Expand All @@ -1846,7 +1843,6 @@ extern "rust-intrinsic" {
/// is selected, and that may depend on optimization level and context, for
/// example.
#[rustc_nounwind]
#[cfg(not(bootstrap))]
pub fn fmuladdf128(a: f128, b: f128, c: f128) -> f128;

/// Returns the largest integer less than or equal to an `f16`.
Expand Down Expand Up @@ -2541,7 +2537,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);

Expand Down Expand Up @@ -3070,7 +3066,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 {
Expand All @@ -3095,7 +3091,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 {
Expand Down Expand Up @@ -3196,13 +3192,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);
}
Expand Down Expand Up @@ -3300,13 +3296,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);
}
Expand Down Expand Up @@ -3381,13 +3377,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);
}
Expand Down
3 changes: 0 additions & 3 deletions core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@
//
// Language features:
// tidy-alphabetical-start
#![cfg_attr(bootstrap, feature(const_mut_refs))]
#![cfg_attr(bootstrap, feature(const_refs_to_cell))]
#![cfg_attr(bootstrap, feature(const_refs_to_static))]
#![feature(abi_unadjusted)]
#![feature(adt_const_params)]
#![feature(allow_internal_unsafe)]
Expand Down
8 changes: 1 addition & 7 deletions core/src/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,11 +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"
)]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(feature = "const_maybe_uninit_as_mut_ptr", since = "1.83.0")]
#[inline(always)]
pub const fn as_mut_ptr(&mut self) -> *mut T {
// `MaybeUninit` and `ManuallyDrop` are both `repr(transparent)` so we can cast the pointer.
Expand Down Expand Up @@ -913,7 +909,6 @@ impl<T> MaybeUninit<T> {
/// };
/// ```
#[stable(feature = "maybe_uninit_ref", since = "1.55.0")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_stable(
feature = "const_maybe_uninit_assume_init",
since = "CURRENT_RUSTC_VERSION"
Expand Down Expand Up @@ -1003,7 +998,6 @@ impl<T> MaybeUninit<T> {
///
/// [`assume_init_mut`]: MaybeUninit::assume_init_mut
#[unstable(feature = "maybe_uninit_slice", issue = "63569")]
#[cfg_attr(bootstrap, rustc_allow_const_fn_unstable(const_mut_refs))]
#[rustc_const_unstable(feature = "maybe_uninit_slice", issue = "63569")]
#[inline(always)]
pub const unsafe fn slice_assume_init_mut(slice: &mut [Self]) -> &mut [T] {
Expand Down
3 changes: 1 addition & 2 deletions core/src/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,8 +857,7 @@ pub fn take<T: Default>(dest: &mut T) -> T {
#[inline]
#[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!
Expand Down
Loading

0 comments on commit f7b3231

Please sign in to comment.