Auto merge of #14232 - HKalbasi:mir, r=Veykril

MIR episode 2

This PR adds:
1. `need-mut` and `unused-mut` diagnostics
2. `View mir` command which shows MIR for the body under cursor, useful for debugging
3. MIR lowering for or-patterns and for-loops
This commit is contained in:
bors 2023-03-07 09:49:49 +00:00
commit 44ff3c407a
57 changed files with 3164 additions and 760 deletions

View file

@ -762,6 +762,20 @@ pub mod iter {
self
}
}
pub struct IntoIter<T, const N: usize>([T; N]);
impl<T, const N: usize> IntoIterator for [T; N] {
type Item = T;
type IntoIter = IntoIter<T, N>;
fn into_iter(self) -> I {
IntoIter(self)
}
}
impl<T, const N: usize> Iterator for IntoIter<T, N> {
type Item = T;
fn next(&mut self) -> Option<T> {
loop {}
}
}
}
pub use self::collect::IntoIterator;
}