Skip to content

Commit 784e4ba

Browse files
authored
Rollup merge of #92879 - compiler-errors:into_iter_unsound, r=dtolnay
Add Sync bound to allocator parameter in vec::IntoIter The `A: Sync` bound was forgotten in 8725e4c#diff-b78c3ab6d37f4ede32195707528f8a76c49d4557cc9d3a7a09417b5157729b9fR3132 Similar `unsafe impl Sync` in that commit _do_ include the `A: Sync` bound (and around the alloc lib), so I think this was just an honest mistake. Here's an example of the unsoundness: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=16cbfeff7c934ae72ab632c1476fdd8b `@steffahn` found this, I'm just putting up the fix cause nobody else did :^) Fixes #92633
2 parents 85c119c + 7debb5c commit 784e4ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/alloc/src/vec/into_iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ impl<T, A: Allocator> AsRef<[T]> for IntoIter<T, A> {
125125
#[stable(feature = "rust1", since = "1.0.0")]
126126
unsafe impl<T: Send, A: Allocator + Send> Send for IntoIter<T, A> {}
127127
#[stable(feature = "rust1", since = "1.0.0")]
128-
unsafe impl<T: Sync, A: Allocator> Sync for IntoIter<T, A> {}
128+
unsafe impl<T: Sync, A: Allocator + Sync> Sync for IntoIter<T, A> {}
129129

130130
#[stable(feature = "rust1", since = "1.0.0")]
131131
impl<T, A: Allocator> Iterator for IntoIter<T, A> {

0 commit comments

Comments
 (0)