diff options
| author | The8472 <git@infinite-source.de> | 2020-05-19 00:44:16 +0200 |
|---|---|---|
| committer | The8472 <git@infinite-source.de> | 2020-09-03 20:59:32 +0200 |
| commit | bec9f9223cefb50cdb4a9b8a7d056545fa3641c2 (patch) | |
| tree | d144ca46a2fa9dd4ba917fb575a182de97c2c480 /library/alloc/src | |
| parent | 80638330f29264591ffea866c807851093abb2fd (diff) | |
| download | rust-bec9f9223cefb50cdb4a9b8a7d056545fa3641c2.tar.gz rust-bec9f9223cefb50cdb4a9b8a7d056545fa3641c2.zip | |
apply required min_specialization attributes
Diffstat (limited to 'library/alloc/src')
| -rw-r--r-- | library/alloc/src/vec.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index db012762419..c0c63a27be5 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -2240,9 +2240,14 @@ fn write_in_place_with_drop<T>( } } +#[rustc_unsafe_specialization_marker] +trait SourceIterMarker: SourceIter<Source: AsIntoIter> {} + +impl<T> SourceIterMarker for T where T: SourceIter<Source: AsIntoIter> {} + impl<T, I> SpecFrom<T, I> for Vec<T> where - I: Iterator<Item = T> + InPlaceIterable + SourceIter<Source: AsIntoIter>, + I: Iterator<Item = T> + InPlaceIterable + SourceIterMarker, { default fn from_iter(mut iterator: I) -> Self { // Additional requirements which cannot expressed via trait bounds. We rely on const eval @@ -3015,6 +3020,7 @@ unsafe impl<T> SourceIter for IntoIter<T> { } // internal helper trait for in-place iteration specialization. +#[rustc_specialization_trait] pub(crate) trait AsIntoIter { type Item; fn as_into_iter(&mut self) -> &mut IntoIter<Self::Item>; |
