File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ // Tests that HRTBs are correctly accepted -- https://github.com/rust-lang/rust/issues/50301
2+ // check-pass
3+ trait Trait
4+ where
5+ for < ' a > & ' a Self :: IntoIter : IntoIterator < Item = u32 > ,
6+ {
7+ type IntoIter ;
8+ fn get ( & self ) -> Self :: IntoIter ;
9+ }
10+
11+ struct Impl ( Vec < u32 > ) ;
12+
13+ impl Trait for Impl {
14+ type IntoIter = ImplIntoIter ;
15+ fn get ( & self ) -> Self :: IntoIter {
16+ ImplIntoIter ( self . 0 . clone ( ) )
17+ }
18+ }
19+
20+ struct ImplIntoIter ( Vec < u32 > ) ;
21+
22+ impl < ' a > IntoIterator for & ' a ImplIntoIter {
23+ type Item = <Self :: IntoIter as Iterator >:: Item ;
24+ type IntoIter = std:: iter:: Cloned < std:: slice:: Iter < ' a , u32 > > ;
25+ fn into_iter ( self ) -> Self :: IntoIter {
26+ ( & self . 0 ) . into_iter ( ) . cloned ( )
27+ }
28+ }
29+
30+ fn main ( ) {
31+ }
You can’t perform that action at this time.
0 commit comments