mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Infer types of nested RPITs
This commit is contained in:
parent
44cf8ef49a
commit
a584cb998f
5 changed files with 105 additions and 34 deletions
|
@ -891,12 +891,19 @@ pub mod iter {
|
|||
self
|
||||
}
|
||||
}
|
||||
pub struct IntoIter<T, const N: usize>([T; N]);
|
||||
struct IndexRange {
|
||||
start: usize,
|
||||
end: usize,
|
||||
}
|
||||
pub struct IntoIter<T, const N: usize> {
|
||||
data: [T; N],
|
||||
range: IndexRange,
|
||||
}
|
||||
impl<T, const N: usize> IntoIterator for [T; N] {
|
||||
type Item = T;
|
||||
type IntoIter = IntoIter<T, N>;
|
||||
fn into_iter(self) -> I {
|
||||
IntoIter(self)
|
||||
IntoIter { data: self, range: IndexRange { start: 0, end: self.len() } }
|
||||
}
|
||||
}
|
||||
impl<T, const N: usize> Iterator for IntoIter<T, N> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue