1
Fork 0

Replace Deref bounds on Interner in favor of a SliceLike trait

This commit is contained in:
Michael Goulet 2024-06-21 13:55:21 -04:00
parent f26cc349d9
commit 24e41f1d13
22 changed files with 221 additions and 159 deletions

View file

@ -133,6 +133,20 @@ impl<H, T> RawList<H, T> {
}
}
impl<'a, H, T: Copy> rustc_type_ir::inherent::SliceLike for &'a RawList<H, T> {
type Item = T;
type IntoIter = iter::Copied<<&'a [T] as IntoIterator>::IntoIter>;
fn iter(self) -> Self::IntoIter {
(*self).iter()
}
fn as_slice(&self) -> &[Self::Item] {
(*self).as_slice()
}
}
macro_rules! impl_list_empty {
($header_ty:ty, $header_init:expr) => {
impl<T> RawList<$header_ty, T> {