Auto merge of #145665 - GrigorenkoPV:144707, r=tgross35

Don't require `T: RefUnwindSafe` for `vec::IntoIter<T>: UnwindSafe`

Closes rust-lang/rust#144707

r? t-libs-api
This commit is contained in:
bors
2025-10-26 06:35:34 +00:00

View File

@@ -7,6 +7,7 @@ use core::mem::{ManuallyDrop, MaybeUninit, SizedTypeProperties};
use core::num::NonZero; use core::num::NonZero;
#[cfg(not(no_global_oom_handling))] #[cfg(not(no_global_oom_handling))]
use core::ops::Deref; use core::ops::Deref;
use core::panic::UnwindSafe;
use core::ptr::{self, NonNull}; use core::ptr::{self, NonNull};
use core::slice::{self}; use core::slice::{self};
use core::{array, fmt}; use core::{array, fmt};
@@ -60,6 +61,11 @@ pub struct IntoIter<
pub(super) end: *const T, pub(super) end: *const T,
} }
// Manually mirroring what `Vec` has,
// because otherwise we get `T: RefUnwindSafe` from `NonNull`.
#[stable(feature = "catch_unwind", since = "1.9.0")]
impl<T: UnwindSafe, A: Allocator + UnwindSafe> UnwindSafe for IntoIter<T, A> {}
#[stable(feature = "vec_intoiter_debug", since = "1.13.0")] #[stable(feature = "vec_intoiter_debug", since = "1.13.0")]
impl<T: fmt::Debug, A: Allocator> fmt::Debug for IntoIter<T, A> { impl<T: fmt::Debug, A: Allocator> fmt::Debug for IntoIter<T, A> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {