Skip to content

Commit

Permalink
Restore remaining uses of #![feature(associated_type_bounds)]
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed May 2, 2024
1 parent b2630f3 commit dfa2d8f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
20 changes: 5 additions & 15 deletions crates/sel4-async/block-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ impl<T> NextBlockSizeAdapter<T> {
wrapper_methods!(T);
}

impl<T: BlockIOLayout> BlockIOLayout for NextBlockSizeAdapter<T>
where
T::BlockSize: HasNextBlockSize,
{
impl<T: BlockIOLayout<BlockSize: HasNextBlockSize>> BlockIOLayout for NextBlockSizeAdapter<T> {
type Error = T::Error;

type BlockSize = <T::BlockSize as HasNextBlockSize>::NextBlockSize;
Expand All @@ -232,10 +229,7 @@ where
}
}

impl<T: BlockIO<A>, A: Access> BlockIO<A> for NextBlockSizeAdapter<T>
where
T::BlockSize: HasNextBlockSize,
{
impl<T: BlockIO<A, BlockSize: HasNextBlockSize>, A: Access> BlockIO<A> for NextBlockSizeAdapter<T> {
async fn read_or_write_blocks(
&self,
start_block_idx: u64,
Expand All @@ -261,10 +255,7 @@ impl<T> PrevBlockSizeAdapter<T> {
wrapper_methods!(T);
}

impl<T: BlockIOLayout> BlockIOLayout for PrevBlockSizeAdapter<T>
where
T::BlockSize: HasPrevBlockSize,
{
impl<T: BlockIOLayout<BlockSize: HasPrevBlockSize>> BlockIOLayout for PrevBlockSizeAdapter<T> {
type Error = T::Error;

type BlockSize = <T::BlockSize as HasPrevBlockSize>::PrevBlockSize;
Expand All @@ -278,9 +269,8 @@ where
}
}

impl<T: BlockIO<A>, A: ReadAccess> BlockIO<A> for PrevBlockSizeAdapter<T>
where
T::BlockSize: HasPrevBlockSize,
impl<T: BlockIO<A, BlockSize: HasPrevBlockSize>, A: ReadAccess> BlockIO<A>
for PrevBlockSizeAdapter<T>
{
async fn read_or_write_blocks(
&self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,10 @@ fn main() -> Result<(), io::Error> {
fs::write(out_elf_path, out_elf)
}

fn with_bit_width<T>(image_elf: &[u8], content: &[u8]) -> Vec<u8>
where
T: FileHeaderExt,
T::Word: PrimInt,
T::Sword: PrimInt,
{
fn with_bit_width<T: FileHeaderExt<Word: PrimInt, Sword: PrimInt>>(
image_elf: &[u8],
content: &[u8],
) -> Vec<u8> {
let content_len = NumCast::from(content.len()).unwrap();
let mut input = Input::<T>::default();
input.symbolic_injections.push(SymbolicInjection {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ impl<T: SlotStateTypes> SlotTracker<T> {

pub fn new_with_capacity(common: T::Common, free: T::Free, capacity: usize) -> Self
where
T: SlotStateTypes,
T::Common: Clone,
T::Free: Clone,
T: SlotStateTypes<Common: Clone, Free: Clone>,
{
Self::new(iter::repeat((common, free)).take(capacity))
}
Expand All @@ -96,9 +94,7 @@ impl<T: SlotStateTypes> SlotTracker<T> {
capacity: usize,
) -> Self
where
T: SlotStateTypes,
T::Common: Clone,
T::Occupied: Clone,
T: SlotStateTypes<Common: Clone, Occupied: Clone>,
{
Self::new_occupied(iter::repeat((common, occupied)).take(capacity))
}
Expand Down

0 comments on commit dfa2d8f

Please sign in to comment.