]> git.lizzy.rs Git - rust.git/blob - src/test/ui/specialization/min_specialization/spec-iter.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / test / ui / specialization / min_specialization / spec-iter.rs
1 // Check that we can specialize on a concrete iterator type. This requires us
2 // to consider which parameters in the parent impl are constrained.
3
4 // check-pass
5
6 #![feature(min_specialization)]
7
8 trait SpecFromIter<T> {
9     fn f(&self);
10 }
11
12 impl<'a, T: 'a, I: Iterator<Item = &'a T>> SpecFromIter<T> for I {
13     default fn f(&self) {}
14 }
15
16 impl<'a, T> SpecFromIter<T> for std::slice::Iter<'a, T> {
17     fn f(&self) {}
18 }
19
20 fn main() {}