Skip to content

Commit 6fc0dea

Browse files
authored
Rollup merge of rust-lang#145665 - GrigorenkoPV:144707, r=tgross35
Don't require `T: RefUnwindSafe` for `vec::IntoIter<T>: UnwindSafe` Closes rust-lang#144707 r? t-libs-api
2 parents cc63a0a + 144707a commit 6fc0dea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/alloc/src/vec/into_iter.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use core::mem::{ManuallyDrop, MaybeUninit, SizedTypeProperties};
77
use core::num::NonZero;
88
#[cfg(not(no_global_oom_handling))]
99
use core::ops::Deref;
10+
use core::panic::UnwindSafe;
1011
use core::ptr::{self, NonNull};
1112
use core::slice::{self};
1213
use core::{array, fmt};
@@ -60,6 +61,11 @@ pub struct IntoIter<
6061
pub(super) end: *const T,
6162
}
6263

64+
// Manually mirroring what `Vec` has,
65+
// because otherwise we get `T: RefUnwindSafe` from `NonNull`.
66+
#[stable(feature = "catch_unwind", since = "1.9.0")]
67+
impl<T: UnwindSafe, A: Allocator + UnwindSafe> UnwindSafe for IntoIter<T, A> {}
68+
6369
#[stable(feature = "vec_intoiter_debug", since = "1.13.0")]
6470
impl<T: fmt::Debug, A: Allocator> fmt::Debug for IntoIter<T, A> {
6571
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)