diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-04-25 21:12:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-25 21:12:18 +0200 |
| commit | 3c0c5b4e46178f6e96d4e147c0ae76db2e5102ae (patch) | |
| tree | ad81bd15e5267c60d097dabe40c3b23f069080e6 | |
| parent | 6c21abf29170f0421fc4f291ed31fa94bb3feebc (diff) | |
| parent | ce705847535d98a2409fc1160b61506d9e6e36fe (diff) | |
| download | rust-3c0c5b4e46178f6e96d4e147c0ae76db2e5102ae.tar.gz rust-3c0c5b4e46178f6e96d4e147c0ae76db2e5102ae.zip | |
Rollup merge of #124380 - lcnr:std-unnecessary-params, r=Nilstrieb
`Range` iteration specialization: remove trivial bounds These bounds on impl items are trivially true and never checked by a caller. They end up shadowing the actual impls, currently preventing normalization in the new solver. While we may have to fix the underlying issue in the new solver at some point, for now this is an easy way to get us closer to compiling core with `-Znext-solver`. r? `@Nilstrieb`
| -rw-r--r-- | library/core/src/iter/adapters/step_by.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/library/core/src/iter/adapters/step_by.rs b/library/core/src/iter/adapters/step_by.rs index 616dd0afc51..a5cf069d407 100644 --- a/library/core/src/iter/adapters/step_by.rs +++ b/library/core/src/iter/adapters/step_by.rs @@ -515,9 +515,7 @@ macro_rules! spec_int_ranges_r { unsafe impl StepByBackImpl<Range<$t>> for StepBy<Range<$t>> { #[inline] - fn spec_next_back(&mut self) -> Option<Self::Item> - where Range<$t>: DoubleEndedIterator + ExactSizeIterator, - { + fn spec_next_back(&mut self) -> Option<Self::Item> { let step = self.original_step().get() as $t; let remaining = self.iter.end; if remaining > 0 { @@ -533,9 +531,7 @@ macro_rules! spec_int_ranges_r { // We have to repeat them here so that the specialization overrides the StepByImplBack defaults #[inline] - fn spec_nth_back(&mut self, n: usize) -> Option<Self::Item> - where Self: DoubleEndedIterator, - { + fn spec_nth_back(&mut self, n: usize) -> Option<Self::Item> { if self.advance_back_by(n).is_err() { return None; } @@ -544,10 +540,9 @@ macro_rules! spec_int_ranges_r { #[inline] fn spec_try_rfold<Acc, F, R>(&mut self, init: Acc, mut f: F) -> R - where - Self: DoubleEndedIterator, - F: FnMut(Acc, Self::Item) -> R, - R: Try<Output = Acc> + where + F: FnMut(Acc, Self::Item) -> R, + R: Try<Output = Acc> { let mut accum = init; while let Some(x) = self.next_back() { @@ -558,9 +553,8 @@ macro_rules! spec_int_ranges_r { #[inline] fn spec_rfold<Acc, F>(mut self, init: Acc, mut f: F) -> Acc - where - Self: DoubleEndedIterator, - F: FnMut(Acc, Self::Item) -> Acc + where + F: FnMut(Acc, Self::Item) -> Acc { let mut accum = init; while let Some(x) = self.next_back() { |
