Replace Deref bounds on Interner in favor of a SliceLike trait
This commit is contained in:
parent
f26cc349d9
commit
24e41f1d13
22 changed files with 221 additions and 159 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue