Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit bec9f92

Browse files
committed
apply required min_specialization attributes
1 parent 8063833 commit bec9f92

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

library/alloc/src/vec.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2240,9 +2240,14 @@ fn write_in_place_with_drop<T>(
22402240
}
22412241
}
22422242

2243+
#[rustc_unsafe_specialization_marker]
2244+
trait SourceIterMarker: SourceIter<Source: AsIntoIter> {}
2245+
2246+
impl<T> SourceIterMarker for T where T: SourceIter<Source: AsIntoIter> {}
2247+
22432248
impl<T, I> SpecFrom<T, I> for Vec<T>
22442249
where
2245-
I: Iterator<Item = T> + InPlaceIterable + SourceIter<Source: AsIntoIter>,
2250+
I: Iterator<Item = T> + InPlaceIterable + SourceIterMarker,
22462251
{
22472252
default fn from_iter(mut iterator: I) -> Self {
22482253
// Additional requirements which cannot expressed via trait bounds. We rely on const eval
@@ -3015,6 +3020,7 @@ unsafe impl<T> SourceIter for IntoIter<T> {
30153020
}
30163021

30173022
// internal helper trait for in-place iteration specialization.
3023+
#[rustc_specialization_trait]
30183024
pub(crate) trait AsIntoIter {
30193025
type Item;
30203026
fn as_into_iter(&mut self) -> &mut IntoIter<Self::Item>;

library/core/src/iter/traits/marker.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,5 @@ unsafe impl<I: TrustedLen + ?Sized> TrustedLen for &mut I {}
5353
///
5454
/// [`SourceIter`]: ../../std/iter/trait.SourceIter.html
5555
#[unstable(issue = "none", feature = "inplace_iteration")]
56+
#[rustc_specialization_trait]
5657
pub unsafe trait InPlaceIterable: Iterator {}

0 commit comments

Comments
 (0)